Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA Conversion
Hello,
I'm working on an excel VBA macro where when I click on the macro button on the spreadsheet, it should open the chart (from another linked excel file)in html format. Actually this excel program was created in excel 95 by someone. I want to use it in Excel 2000/2002. The chart was saved in a GIF format using a third party software (Paint Shop) and then was copied to Word or directly converted to html format. __________________________________________________ ________ Sub SaveLPGCP() OriginalState = ActiveWindow.WindowState ActiveWindow.WindowState = xlNormal Application.Calculation = xlAutomatic Workbooks.Open HtmlPath & "LPG.XLS" SavePicture ChartName:="Graph", SaveName:="LPG-CP.HTM" Workbooks("LPG.XLS").Close saveChanges:=False End Sub __________________________________________________ ________ Sub SavePicture(ChartName, SaveName) CopyPicture (ChartName) x = Shell(ToolPath & "PSP.EXE", 1) SendKeys "{TAB}~", True SendKeys "^v~", True SendKeys "%cd1", True SendKeys "%p%n~", True Application.Wait Now + TimeValue("00:00:" & Application.Fixed(WaitState, 0)) SendKeys "%fx", True SendKeys "y", True SendKeys "%tg%n", True SendKeys SavePath, True SendKeys SaveName, True SendKeys "~~", True Application.Wait Now + TimeValue("00:00:" & Application.Fixed(1.5 * WaitState, 0)) End Sub __________________________________________________ ________ Sub CopyPicture(ChartName) With ActiveWindow .WindowState = xlNormal .Width = SizeW .Height = SizeH End With ActiveWorkbook.Charts(ChartName).CopyPicture Appearance:=xlScreen, _ Size:=xlScreen, Format:=xlPicture End Sub __________________________________________________ ________ I also want the chart to be updated each time changes is made in the worksheets. Can anybody show me how to solve this problem in excel 2000/2002? Thank you. Regards, Sheela |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Conversion | New Users to Excel | |||
Excel conversion to PDF? | Excel Discussion (Misc queries) | |||
Excel conversion | New Users to Excel | |||
Excel conversion | New Users to Excel | |||
Excel to PDF conversion in VB | Excel Discussion (Misc queries) |