View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Chart2JPG and export to webpage directory

Try exporting it as a .gif and don't include the 'FilterName' argument at
all, or FilterName as an empty string, "".

Regards,
Peter T

wrote in message
oups.com...
Morning,

I am building an Excel workbook to automaticly update my website by
clicking a macro. For publishing of my data i have a good working VBA
code but the related graphs to this data should be published as well.
So, in order to do that i wanted to add this code (see below).
This VBA code works perfectly in a local directory environment (C / D
drive). But i want to save it to: http://servername/myhomepage/randomdir.
Replacing the desktop directory with the http directory does not work.
Does anyone have a solution



Sub ExportChart2JPG()

Sheets("Graphs").Select
ActiveSheet.ChartObjects("Grafiek 2").Activate
ActiveChart.ChartArea.Select
ActiveChart.Export Filename:="C:\Documents and Settings\Erik\Desktop
\Grafiek2.jpg", _
FilterName:="jpeg"

End Sub