Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a graph as .jpg

Hi,
I am trying to plot a graph using Macro and could do that. But I have
to store that graph as a .jpg or .gif file. Is there any way i could do
that automatically(like macro)? Could anybody help me in doing this.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Saving a graph as .jpg

If you save the file as a web page, the graph will automatically be
saved as a .gif.

For instance, if you save the one-sheet workbook foo.xls as a web
page, the graph will be saved in the foo_files directory (which is
at the same level as foo.htm) as image001.gif.


In article ,
haisat wrote:

I am trying to plot a graph using Macro and could do that. But I have
to store that graph as a .jpg or .gif file. Is there any way i could do
that automatically(like macro)? Could anybody help me in doing this.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a graph as .jpg

Hi,
Thanks for your answer but I didnt get exactly what you said. First i
saved the file as .xls and then how to save as webpage? one more
question is it possible to make this automation(through Macro or some
other way)?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Saving a graph as .jpg

You needn't save it as an .xls file first. Manually: Use File/Save
As Web Page (or choose Web Page from the File/Save As dialog's
Format dropdown).

Programmatically: try recording a macro of saving as a web page, and
modifying from there. Post back with your code if you need help.

In article ,
haisat wrote:

Hi,
Thanks for your answer but I didnt get exactly what you said. First i
saved the file as .xls and then how to save as webpage? one more
question is it possible to make this automation(through Macro or some
other way)?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a graph as .jpg

Hi,
To be frank I couldnt find any option to save as Web page in my Excel.
I am using Excel 97. Is it newly added with 2000?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Saving a graph as .jpg

No, You need to do toolsadd-ins, check the internet assistant.

--

John

johnf202 at hotmail dot com


"haisat" wrote in message
...
Hi,
To be frank I couldnt find any option to save as Web page in my Excel.
I am using Excel 97. Is it newly added with 2000?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Saving a graph as .jpg

Note that you will need SR1 at least to do it programmatically and I don't
believe recording will work.

But you may want to look at this first:

http://support.microsoft.com/?id=163103
How to Create a GIF File from a Microsoft Excel Chart

for a JPG I did:
Sub Create_JPG()
Dim mychart As Chart
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export Filename:="F:\Mychart.jpg", FilterName:="JPG"
End Sub

and it worked for me.

If you still want to go the Save As Html route in VBA:

Microsoft Information on VBA and HTML:

http://office.microsoft.com/downloads/9798/html.aspx
http://www.microsoft.com/downloads/d...displaylang=EN
Internet Assistant Wizard Update for Excel

http://support.microsoft.com/?id=147273
XL: The Internet Assistant Wizard (Html.xla)
(basically redundant to the above)

http://support.microsoft.com/?id=168561
XL97: How to Programmatically Save a Worksheet as HTML
(Has sample code)


http://support.microsoft.com/?id=172165
XL97: Error Creating Web Page with Option Base 1 Setting

http://support.microsoft.com/?id=172305
XL97: LastUpdated Argument of Htmlconvert Is Not Functional
(Has sample code)

http://support.microsoft.com/support...el97/xlweb.asp
Microsoft Excel 97 on the Web

http://support.microsoft.com/support...d/webform3.asp
Creating a Form to Use With the Web Form Wizard

http://support.microsoft.com/?id=150004
MS Excel Internet Assistant Wizard: Removing Gridlines in HTML

http://support.microsoft.com/?id=163103
How to Create a GIF File from a Microsoft Excel Chart

I haven't checked the links in a while - hopefully they all still work.

--
Regards,
Tom Ogilvy


"jaf" wrote in message
...
No, You need to do toolsadd-ins, check the internet assistant.

--

John

johnf202 at hotmail dot com


"haisat" wrote in message
...
Hi,
To be frank I couldnt find any option to save as Web page in my Excel.
I am using Excel 97. Is it newly added with 2000?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Saving a graph as .jpg

ActiveChart.Export FileName:="D:\MyChart.jpg", FilterName:="JPEG"

also see Harold Staff's write up in
XL2GIF routine
ttp://www.mvps.org/dmcritchie/excel/xl2gif.htm
which places picture of a group of cells onto a graph so it can create
a .jpeg file.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"haisat" wrote
I am trying to plot a graph using Macro and could do that. But I have
to store that graph as a .jpg or .gif file. Is there any way i could do
that automatically(like macro)? Could anybody help me in doing this.




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Saving a graph as .jpg

for gif just change reference to .jpg to .gif
Sub ExportChartGIF()
ActiveChart.Export Filename:="C:\a\MyChart.gif",FilterName:="GIF"
End Sub

"David McRitchie" wrote in message
...
ActiveChart.Export FileName:="D:\MyChart.jpg", FilterName:="JPEG"

also see Harold Staff's write up in
XL2GIF routine
ttp://www.mvps.org/dmcritchie/excel/xl2gif.htm
which places picture of a group of cells onto a graph so it can create
a .jpeg file.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"haisat" wrote
I am trying to plot a graph using Macro and could do that. But I have
to store that graph as a .jpg or .gif file. Is there any way i could do
that automatically(like macro)? Could anybody help me in doing this.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining a 2-D column graph and a 2-D line graph on the same char Filippo Charts and Charting in Excel 3 February 23rd 10 12:34 AM
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
How do I graph data daily as a line graph across a calendar format Glani Charts and Charting in Excel 3 November 23rd 07 09:05 AM
Cluster stacked graph AND line combo graph? [email protected] Charts and Charting in Excel 6 October 14th 06 12:33 AM
Hyperlinkage of one graph with another graph or Drill down graph Sanjay Kumar Singh Charts and Charting in Excel 1 January 3rd 06 12:22 PM


All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"