S
Sheela
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
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