Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chart2JPG and export to webpage directory
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chart2JPG and export to webpage directory
I tried it with the following code but still no succes. Any more
suggestions or is my code faulty? <uQuote of error message:</u Error 1004 during execution Export of object_chart failes <uVBA Code used:</u Sub ExportChart2JPG() Sheets("Graphs").Select ActiveSheet.ChartObjects("Grafiek 2").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="http://ehvtintra/ehv-hog/Energy%20and %20Emissions%20SSI/Excel/Grafiek2.gif" End Sub Peter T schreef: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chart2JPG and export to webpage directory
The export chart method can be problematic with the Filtername argument
included, but it seems that's not the cause of your problem. Your code looks OK but I can't test saving to a server. BTW, you don't need to select the chart, eg Sheets("Graphs").ChartObjects("Grafiek 2").Chart.Export sFileName Try exporting to your local drive first, then copy or upload the file to your server. If that works, and you particularly want to save as a jpg try that as well. But even with .jpg you can probably drop the FilterName argument. FWIW charts are generally better suited to gif's rather than jpg's, unless they include particular images. Regards, Peter T wrote in message ups.com... I tried it with the following code but still no succes. Any more suggestions or is my code faulty? <uQuote of error message:</u Error 1004 during execution Export of object_chart failes <uVBA Code used:</u Sub ExportChart2JPG() Sheets("Graphs").Select ActiveSheet.ChartObjects("Grafiek 2").Activate ActiveChart.ChartArea.Select ActiveChart.Export Filename:="http://ehvtintra/ehv-hog/Energy%20and %20Emissions%20SSI/Excel/Grafiek2.gif" End Sub Peter T schreef: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change current directory to the directory that the workbook loads from! | Excel Programming | |||
Enter data into excel and export it to a webpage | Excel Programming | |||
Creating a macro that lists directory names within a directory.... | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming |