ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Request Vba code Export gif file (https://www.excelbanter.com/excel-programming/291429-request-vba-code-export-gif-file.html)

Luigi[_2_]

Request Vba code Export gif file
 
I have problem with code Excel-vba: I have this code

Private Sub make_Gif()
x = 22
For k = 1 To x
Dim mychart As Chart
Set mychart = Sheets("DATA").ChartObjects(k).Chart
mychart.Export Filename:="c:\" & k & ".gif", FilterName:="gif"
Next k
End Sub
This code is testing ok!
This code VBA, Export 22 charts to gif file format , named with number k (1-22)
c:\1.gif
c:\2.gif
c:\...
c:\22.gif
I want export this charts in c:\ChartTitle.Gif
c:\salesI.Gif
c:\salesII.Gif
c:\Integration.Gif
c:\.......
ChartTitle=Title of Chart



it's possible?

Plese help me
Thank for all!!

My e-mail:

acw[_2_]

Request Vba code Export gif file
 
Luig

Tr
mychart.Export Filename:="c:\" & mychart.charttitle.text & ".gif", FilterName:="gif
Ton

----- Luigi wrote: ----

I have problem with code Excel-vba: I have this cod

Private Sub make_Gif(
x = 2
For k = 1 To
Dim mychart As Char
Set mychart = Sheets("DATA").ChartObjects(k).Char
mychart.Export Filename:="c:\" & k & ".gif", FilterName:="gif
Next
End Su
This code is testing ok
This code VBA, Export 22 charts to gif file format , named with number k (1-22
c:\1.gi
c:\2.gi
c:\..
c:\22.gi
I want export this charts in c:\ChartTitle.Gi
c:\salesI.Gi
c:\salesII.Gi
c:\Integration.Gi
c:\......
ChartTitle=Title of Char



it's possible

Plese help m
Thank for all!

My e-mail:


Wouter HM

Request Vba code Export gif file
 
Ho Luigi,

This should do the trick:

Private Sub make_Gif()
Dim k As Integer
Dim t As String
Dim mychart As Chart

For k = 1 To Sheets("blad1").ChartObjects.Count
Set mychart = Sheets("blad1").ChartObjects(k).Chart
t = mychart.ChartTitle.Caption
mychart.Export Filename:="c:\" & t & ".gif", FilterName:="gif"
Next k
End Sub


Good Luck

Wouter HM

(Luigi) wrote in message . com...
I have problem with code Excel-vba: I have this code

Private Sub make_Gif()
x = 22
For k = 1 To x
Dim mychart As Chart
Set mychart = Sheets("DATA").ChartObjects(k).Chart
mychart.Export Filename:="c:\" & k & ".gif", FilterName:="gif"
Next k
End Sub
This code is testing ok!
This code VBA, Export 22 charts to gif file format , named with number k (1-22)
c:\1.gif
c:\2.gif
c:\...
c:\22.gif
I want export this charts in c:\ChartTitle.Gif
c:\salesI.Gif
c:\salesII.Gif
c:\Integration.Gif
c:\.......
ChartTitle=Title of Chart



it's possible?

Plese help me
Thank for all!!

My e-mail:


Luigi[_2_]

Thank Tony
 
This cosde Vba is ok!

mychart.Export Filename:="c:\" & mychart.charttitle.text & ".gif",
FilterName:="gif"

Thank very much, Tony


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com