PC Review


Reply
Thread Tools Rate Thread

Chart2JPG and export to webpage directory

 
 
erooijackers@gmail.com
Guest
Posts: n/a
 
      21st Jun 2007
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 With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      21st Jun 2007
Try exporting it as a .gif and don't include the 'FilterName' argument at
all, or FilterName as an empty string, "".

Regards,
Peter T

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
erooijackers@gmail.com
Guest
Posts: n/a
 
      21st Jun 2007
I tried it with the following code but still no succes. Any more
suggestions or is my code faulty?


<u>Quote of error message:</u>
Error 1004 during execution
Export of object_chart failes

<u>VBA 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
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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 With Quote
 
Peter T
Guest
Posts: n/a
 
      21st Jun 2007
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

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I tried it with the following code but still no succes. Any more
> suggestions or is my code faulty?
>
>
> <u>Quote of error message:</u>
> Error 1004 during execution
> Export of object_chart failes
>
> <u>VBA 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
> >
> > <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to show (excel export)webpage in our LAN? Johan2000 Microsoft Excel Programming 2 14th Apr 2008 02:26 AM
Display Active Directory DNS on a webpage? Izu Microsoft ASP .NET 2 17th Apr 2007 10:50 PM
How do I export a Calendar as a Webpage? =?Utf-8?B?TW9oRjE=?= Microsoft Outlook Calendar 2 30th Aug 2006 12:55 PM
Export Graphics to WebPage via Photoshop =?Utf-8?B?U3Rhbg==?= Microsoft Powerpoint 1 6th Dec 2003 03:32 AM
Dynamicly Export Calendar to a Webpage? Tom Microsoft Outlook Calendar 0 17th Jul 2003 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.