Vba : copier modepoint excel07 word00
matin
-
matin -
matin -
Bonjour,
je suis débutante en VBA
j'utilise une macro Vba faite par un ancêtre sous word qui notamment copie des graphes depuis excel dans word
depuis que j'ai excel 2007 (et toujours word 2000...) j'ai un problème : les graphiques sont très moches sous word.
J'essaye donc de les copier en mode point (à la main ça marche très bien) de cette façon sous Vba :
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
mais le graphique est quand même copié en tant qu'image métafichier et pas image en mode point
J'ai essayé le PasteSpecial, de changer le Appearance, mais sans succès non plus...
Help!
comme je n'y connais rien j'envoie le code complet au cas où...
xlApp.DisplayAlerts = False
xlApp.Visible = True
xlApp.AskToUpdateLinks = False
xlApp.Workbooks.Open FileName:="...xls", updatelinks:=0, ReadOnly:=True
xlApp.ActiveWindow.WindowState = xlNormal
xlApp.ActiveWindow.Width = 530
xlApp.ActiveWindow.Height = 200
xlApp.Workbooks(1).Sheets(page1(2 * i - 1)).Select
xlApp.ActiveChart.ChartArea.Select
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
Options.ReplaceSelection = True
ActiveDocument.InlineShapes(i).Select
Selection.Paste Type:=xlPasteFormats
xlApp.ActiveWindow.Close
xlApp.Quit
merci d'avance de votre aide...
je suis débutante en VBA
j'utilise une macro Vba faite par un ancêtre sous word qui notamment copie des graphes depuis excel dans word
depuis que j'ai excel 2007 (et toujours word 2000...) j'ai un problème : les graphiques sont très moches sous word.
J'essaye donc de les copier en mode point (à la main ça marche très bien) de cette façon sous Vba :
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
mais le graphique est quand même copié en tant qu'image métafichier et pas image en mode point
J'ai essayé le PasteSpecial, de changer le Appearance, mais sans succès non plus...
Help!
comme je n'y connais rien j'envoie le code complet au cas où...
xlApp.DisplayAlerts = False
xlApp.Visible = True
xlApp.AskToUpdateLinks = False
xlApp.Workbooks.Open FileName:="...xls", updatelinks:=0, ReadOnly:=True
xlApp.ActiveWindow.WindowState = xlNormal
xlApp.ActiveWindow.Width = 530
xlApp.ActiveWindow.Height = 200
xlApp.Workbooks(1).Sheets(page1(2 * i - 1)).Select
xlApp.ActiveChart.ChartArea.Select
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
Options.ReplaceSelection = True
ActiveDocument.InlineShapes(i).Select
Selection.Paste Type:=xlPasteFormats
xlApp.ActiveWindow.Close
xlApp.Quit
merci d'avance de votre aide...
A voir également:
- Vba : copier modepoint excel07 word00
- Excel compter cellule couleur sans vba - Guide
- Incompatibilité de type vba ✓ - Forum VB / VBA
- Erreur 13 incompatibilité de type VBA excel ✓ - Forum Excel
- Mkdir vba ✓ - Forum VB / VBA
- Dépassement de capacité vba ✓ - Forum Excel
1 réponse
encore moi, désolée je recommence: voici mon code exact :
xlApp.DisplayAlerts = False
xlApp.Visible = True
xlApp.AskToUpdateLinks = False
xlApp.Workbooks.Open FileName:="..xls", updatelinks:=0, ReadOnly:=True
xlApp.ActiveWindow.WindowState = xlNormal
xlApp.ActiveWindow.Width = 530
xlApp.ActiveWindow.Height = 200
xlApp.Workbooks(1).Sheets(page1(2 * i - 1)).Select
xlApp.ActiveChart.ChartArea.Select
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
Options.ReplaceSelection = True
ActiveDocument.InlineShapes(i).Select
Selection.Paste
xlApp.ActiveWindow.Close
xlApp.Quit
xlApp.DisplayAlerts = False
xlApp.Visible = True
xlApp.AskToUpdateLinks = False
xlApp.Workbooks.Open FileName:="..xls", updatelinks:=0, ReadOnly:=True
xlApp.ActiveWindow.WindowState = xlNormal
xlApp.ActiveWindow.Width = 530
xlApp.ActiveWindow.Height = 200
xlApp.Workbooks(1).Sheets(page1(2 * i - 1)).Select
xlApp.ActiveChart.ChartArea.Select
xlApp.ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:=xlBitmap
Options.ReplaceSelection = True
ActiveDocument.InlineShapes(i).Select
Selection.Paste
xlApp.ActiveWindow.Close
xlApp.Quit