PDA

View Full Version : Solved: what's wrong with ActiveChart.Export code



skaswani
10-25-2007, 09:22 AM
Sub ExportChartJPG()
For i = 1 To Sheets.Count

ActiveChart.Export Filename:="C:\mycharts\" & Sheets.Name & ".jpg", _
FilterName:="jpeg"


Next
End Sub





hello


can anyone correct me where i am wrong, what i want to do is, that i want to export my all charts exists on my current sheets export as jpeg or gif" and with the sheet name


ie. if the sheet name is BOP then filename shouldbe bop.jpg or bop.gif


thankyou!

xld
10-25-2007, 09:40 AM
For i = 1 To Sheets.Count

Worksheets(i).ChartObjects(1).Chart.Export _
Filename:="C:\mycharts\" & Worksheets(i).Name & ".jpg", _
FilterName:="jpeg"

Next

skaswani
10-25-2007, 10:19 AM
:)
r u a champ

thank u
:)

lucas
10-25-2007, 10:25 AM
skaswani,
be sure to mark your thread solved using the thread tools at the top of the page.

skaswani
10-25-2007, 11:02 AM
ya, i am about to, just a quick question..

can i re-size the charts hight & Width??

thanks

skaswani
10-25-2007, 11:26 AM
oh, i m done:)

Worksheets(i).ChartObjects(1).Width = 775
Worksheets(i).ChartObjects(1).Width = 675


thanks alot 4 helping