Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Blocage entre excel 2003 sur Windows, et excel 2004 sur Mac.

3 réponses
Avatar
f4crw
Bonsoir à tous,
Mon problème est le suivant, j'ai une procédure qui marche très bien avec
excel 2003 sur Windows, mais qui bloque avec excel 2004 sur Mac.
Un de vous peut certainement me dépanner étant donné que je ne connais pas
le système Mac, voici dans la macro la commande qui n'est pas prise en
compte :
chemin = ActiveWorkbook.Path & "\"
ChDir chemin

Donc, n'exécute pas:
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin & Trombine).Select

(mais exécute bien):
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select

la macro
Sub InserImageFiche()
' Macro enregistrée le 27/02/2008 par Régis
ThisWorkbook.Sheets("Fiche").Visible = True
Sheets("Fiche").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Trombine = ActiveSheet.Range("Trombi_JPG").Value 'non du fichier image
chemin = ActiveWorkbook.Path & "\"
ChDir chemin
On Error Resume Next
ActiveSheet.Shapes("ImageTrombine").Delete 'Suprime l'image existante
Range("G1").Select
If Trombine = "" Then
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
'Image de remplacement
Else
On Error GoTo gestionErreur
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin & Trombine).Select
End If
Redimensionne:
If ImageOuvrirTrombine <> False Then
Selection.Name = "ImageTrombine"
Selection.ShapeRange.ZOrder msoSendToBack
Selection.Locked = True
'Agrandir l'image
If Selection.ShapeRange.Width < 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height < 200 Then
Selection.ShapeRange.Height = 200
End If
'Réduir l'image
If Selection.ShapeRange.Width > 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height > 200 Then
Selection.ShapeRange.Height = 200
End If
'Place l'image
With Selection
.ShapeRange.IncrementLeft -1
.ShapeRange.IncrementTop 30
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.Locked = True
Application.GoTo Reference:="Trombi_JPG"
ActiveCell.Offset(3, 0).Select
End If
ActiveSheet.Shapes("Rectangle 2048").ZOrder msoBringToFront
ActiveSheet.Protect
Exit Sub
gestionErreur:
Temp = MsgBox(" Vérifier la présence du fichier, son nom ou
le type (nom.ext) indiqué " & vbCr & vbCr & "
'' " & Trombine & " '' " & " n'est pas valide !" & vbCr & vbCr & "Vous
pouvez insérer de nombreux fichiers graphiques aux formats les plus
courants, " & vbCr & " .emf, .jpg,
.png, .bmp, .rle, .dib, .gif, .wmf", vbOKOnly + vbDefaultButton1 +
vbInformation, " Le nom ou le type de fichier n'est pas reconnu !!!")
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
GoTo Redimention
ActiveSheet.Protect
End Sub


J'espère que j'ai été suffisamment clair ?

3 réponses

Avatar
f4crw
Bonjour,
Apparemment il n'y a pas d'utilisateur Apple sur ce forum,
l'un d'entrevous peut il me donner un lien d'un forum Mac comme celui-ci où
je peux trouver de l'aide pour mon erreur
la commande :
chemin = ActiveWorkbook.Path & ""
ChDir chemin
merci



"f4crw" a écrit dans le message de news:

Bonsoir à tous,
Mon problème est le suivant, j'ai une procédure qui marche très bien avec
excel 2003 sur Windows, mais qui bloque avec excel 2004 sur Mac.
Un de vous peut certainement me dépanner étant donné que je ne connais pas
le système Mac, voici dans la macro la commande qui n'est pas prise en
compte :
chemin = ActiveWorkbook.Path & ""
ChDir chemin

Donc, n'exécute pas:
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select

(mais exécute bien):
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select

la macro
Sub InserImageFiche()
' Macro enregistrée le 27/02/2008 par Régis
ThisWorkbook.Sheets("Fiche").Visible = True
Sheets("Fiche").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Trombine = ActiveSheet.Range("Trombi_JPG").Value 'non du fichier image
chemin = ActiveWorkbook.Path & ""
ChDir chemin
On Error Resume Next
ActiveSheet.Shapes("ImageTrombine").Delete 'Suprime l'image existante
Range("G1").Select
If Trombine = "" Then
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
'Image de remplacement
Else
On Error GoTo gestionErreur
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select
End If
Redimensionne:
If ImageOuvrirTrombine <> False Then
Selection.Name = "ImageTrombine"
Selection.ShapeRange.ZOrder msoSendToBack
Selection.Locked = True
'Agrandir l'image
If Selection.ShapeRange.Width < 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height < 200 Then
Selection.ShapeRange.Height = 200
End If
'Réduir l'image
If Selection.ShapeRange.Width > 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height > 200 Then
Selection.ShapeRange.Height = 200
End If
'Place l'image
With Selection
.ShapeRange.IncrementLeft -1
.ShapeRange.IncrementTop 30
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.Locked = True
Application.GoTo Reference:="Trombi_JPG"
ActiveCell.Offset(3, 0).Select
End If
ActiveSheet.Shapes("Rectangle 2048").ZOrder msoBringToFront
ActiveSheet.Protect
Exit Sub
gestionErreur:
Temp = MsgBox(" Vérifier la présence du fichier, son nom ou
le type (nom.ext) indiqué " & vbCr & vbCr & " '' " & Trombine & " '' "
& " n'est pas valide !" & vbCr & vbCr & "Vous pouvez insérer de nombreux
fichiers graphiques aux formats les plus courants, " & vbCr & "
.emf, .jpg, .png, .bmp, .rle, .dib, .gif, .wmf", vbOKOnly +
vbDefaultButton1 + vbInformation, " Le nom ou le type de fichier
n'est pas reconnu !!!")
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
GoTo Redimention
ActiveSheet.Protect
End Sub


J'espère que j'ai été suffisamment clair ?


Avatar
Misange
Bonjour

De mémoire, le chemin sur un mac se termine par : et pas par
Sinon, il y a microsoft.public.fr.office.mac comme forum adapté pour les
questions spécifiques mac.
Misange

f4crw a écrit :
Bonjour,
Apparemment il n'y a pas d'utilisateur Apple sur ce forum,
l'un d'entrevous peut il me donner un lien d'un forum Mac comme celui-ci où
je peux trouver de l'aide pour mon erreur
la commande :
chemin = ActiveWorkbook.Path & ""
ChDir chemin
merci



"f4crw" a écrit dans le message de news:

Bonsoir à tous,
Mon problème est le suivant, j'ai une procédure qui marche très bien avec
excel 2003 sur Windows, mais qui bloque avec excel 2004 sur Mac.
Un de vous peut certainement me dépanner étant donné que je ne connais pas
le système Mac, voici dans la macro la commande qui n'est pas prise en
compte :
chemin = ActiveWorkbook.Path & ""
ChDir chemin

Donc, n'exécute pas:
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select

(mais exécute bien):
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select

la macro
Sub InserImageFiche()
' Macro enregistrée le 27/02/2008 par Régis
ThisWorkbook.Sheets("Fiche").Visible = True
Sheets("Fiche").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Trombine = ActiveSheet.Range("Trombi_JPG").Value 'non du fichier image
chemin = ActiveWorkbook.Path & ""
ChDir chemin
On Error Resume Next
ActiveSheet.Shapes("ImageTrombine").Delete 'Suprime l'image existante
Range("G1").Select
If Trombine = "" Then
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
'Image de remplacement
Else
On Error GoTo gestionErreur
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select
End If
Redimensionne:
If ImageOuvrirTrombine <> False Then
Selection.Name = "ImageTrombine"
Selection.ShapeRange.ZOrder msoSendToBack
Selection.Locked = True
'Agrandir l'image
If Selection.ShapeRange.Width < 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height < 200 Then
Selection.ShapeRange.Height = 200
End If
'Réduir l'image
If Selection.ShapeRange.Width > 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height > 200 Then
Selection.ShapeRange.Height = 200
End If
'Place l'image
With Selection
.ShapeRange.IncrementLeft -1
.ShapeRange.IncrementTop 30
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.Locked = True
Application.GoTo Reference:="Trombi_JPG"
ActiveCell.Offset(3, 0).Select
End If
ActiveSheet.Shapes("Rectangle 2048").ZOrder msoBringToFront
ActiveSheet.Protect
Exit Sub
gestionErreur:
Temp = MsgBox(" Vérifier la présence du fichier, son nom ou
le type (nom.ext) indiqué " & vbCr & vbCr & " '' " & Trombine & " '' "
& " n'est pas valide !" & vbCr & vbCr & "Vous pouvez insérer de nombreux
fichiers graphiques aux formats les plus courants, " & vbCr & "
.emf, .jpg, .png, .bmp, .rle, .dib, .gif, .wmf", vbOKOnly +
vbDefaultButton1 + vbInformation, " Le nom ou le type de fichier
n'est pas reconnu !!!")
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
GoTo Redimention
ActiveSheet.Protect
End Sub


J'espère que j'ai été suffisamment clair ?






Avatar
f4crw
Merci et bonne journée

"Misange" a écrit dans le message de news:
%
Bonjour

De mémoire, le chemin sur un mac se termine par : et pas par
Sinon, il y a microsoft.public.fr.office.mac comme forum adapté pour les
questions spécifiques mac.
Misange

f4crw a écrit :
Bonjour,
Apparemment il n'y a pas d'utilisateur Apple sur ce forum,
l'un d'entrevous peut il me donner un lien d'un forum Mac comme celui-ci
où je peux trouver de l'aide pour mon erreur
la commande :
chemin = ActiveWorkbook.Path & ""
ChDir chemin
merci



"f4crw" a écrit dans le message de news:

Bonsoir à tous,
Mon problème est le suivant, j'ai une procédure qui marche très bien
avec excel 2003 sur Windows, mais qui bloque avec excel 2004 sur Mac.
Un de vous peut certainement me dépanner étant donné que je ne connais
pas le système Mac, voici dans la macro la commande qui n'est pas prise
en compte :
chemin = ActiveWorkbook.Path & ""
ChDir chemin

Donc, n'exécute pas:
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select

(mais exécute bien):
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select

la macro
Sub InserImageFiche()
' Macro enregistrée le 27/02/2008 par Régis
ThisWorkbook.Sheets("Fiche").Visible = True
Sheets("Fiche").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Trombine = ActiveSheet.Range("Trombi_JPG").Value 'non du fichier image
chemin = ActiveWorkbook.Path & ""
ChDir chemin
On Error Resume Next
ActiveSheet.Shapes("ImageTrombine").Delete 'Suprime l'image existante
Range("G1").Select
If Trombine = "" Then
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
'Image de remplacement
Else
On Error GoTo gestionErreur
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert(chemin &
Trombine).Select
End If
Redimensionne:
If ImageOuvrirTrombine <> False Then
Selection.Name = "ImageTrombine"
Selection.ShapeRange.ZOrder msoSendToBack
Selection.Locked = True
'Agrandir l'image
If Selection.ShapeRange.Width < 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height < 200 Then
Selection.ShapeRange.Height = 200
End If
'Réduir l'image
If Selection.ShapeRange.Width > 138 Then
Selection.ShapeRange.Width = 138
End If
If Selection.ShapeRange.Height > 200 Then
Selection.ShapeRange.Height = 200
End If
'Place l'image
With Selection
.ShapeRange.IncrementLeft -1
.ShapeRange.IncrementTop 30
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.Locked = True
Application.GoTo Reference:="Trombi_JPG"
ActiveCell.Offset(3, 0).Select
End If
ActiveSheet.Shapes("Rectangle 2048").ZOrder msoBringToFront
ActiveSheet.Protect
Exit Sub
gestionErreur:
Temp = MsgBox(" Vérifier la présence du fichier, son nom
ou le type (nom.ext) indiqué " & vbCr & vbCr & " '' " & Trombine & " ''
" & " n'est pas valide !" & vbCr & vbCr & "Vous pouvez insérer de
nombreux fichiers graphiques aux formats les plus courants, " & vbCr
& " .emf, .jpg, .png, .bmp, .rle, .dib, .gif, .wmf", vbOKOnly +
vbDefaultButton1 + vbInformation, " Le nom ou le type de fichier
n'est pas reconnu !!!")
ImageOuvrirTrombine = ActiveSheet.Pictures.Insert("anonyme.jpg").Select
GoTo Redimention
ActiveSheet.Protect
End Sub


J'espère que j'ai été suffisamment clair ?