![]() |
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/ |
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. |
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/ |
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)? |
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/ |
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/ |
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. |
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/ |
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. |
All times are GMT +1. The time now is 05:12 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com