Bonjour, J'ai fait sous excel 2003 une macro qui me permet d'exporter des images que je regroupe manuellement et exporte vers un fichier externe. Cette macro fonctionne bien sous Excel 2003 mais plus sous excel 2010.
En fait les images regroupées sont bien exportées mais se retrouvent calées en haut à gauche d'un grand rectangle blanc voir doc joint.
Voici le code que j'ai utilisé sous excel 2003
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
NumCode
Dim Im As Picture
Dim NmPhoto As String
Selection.ShapeRange.Group.Select
Selection.ShapeRange.LockAspectRatio = msoTrueSelection.ShapeRange.Height = 567#
Selection.ShapeRange.IncrementLeft -500#
Selection.ShapeRange.IncrementTop -500#
Selection.Copy
NmPhoto = Sheets("RgptPh").Range("A1").Value
        'MsgBox "Photo numéro" & NmPhoto & ""
         'MsgBox "Export NmChemin2 & "BasePlusA\" & NmPhoto & ".jpeg""
    With ActiveSheet.ChartObjects.Add(0, 0, Selection.Width, Selection.Height).Chart
        .ChartArea.Border.LineStyle = 0
        .Paste
        .Export NmChemin2 & "BasePlusA\" & NmPhoto & ".jpeg"
        Excel.Run ("SuppressionAgr")
  End With
End Sub
Nom : Export image.png
Affichages : 138
Taille : 266,4 Ko

Pour me joindre: [EMAIL="g.robin74@laposte.net"]
En vous remerciant de votre aide. Gilles