saving as html

D

Doug

I have about 500 graphs I need to load to the web and they are updated every week. I save them as html files and then grab the images and toss them into front page. The problem is that some of the graphs are not reported every week. Right now, I have a hyperlink pointing to image 034, but since it didn't report this week, it is pointing to the wrong image. This causes a big problem with all the hyperlinks pointing to the wrong charts.
What I would like to do is save the excel graphs according to their excel worksheet name. The graphs are all on their own worksheet and the worksheets are named how I would like the images to be saved. Is it possible to save as an HTML file so that the image files are named after the worksheet name?
 
J

jeff

Hi, Doug,

You might want to play with this macro. (Set your
own directory, of course)

Sub Saveit()
'
' Saveit Macro
'
Dim Chartname As String
Dim Sheet As Worksheet
Dim j, ShtCnt As Integer
ShtCnt = ActiveWorkbook.Worksheets.Count

For j = 1 To ShtCnt
Chartname = ActiveWorkbook.Worksheets(j).Name
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveWorkbook.PublishObjects.Add(xlSourceChart,
_
"C:\MyDirectory\" & Chartname & ".htm",
ActiveWorkbook.Worksheets(j).Name, _
"Chart 1", xlHtmlStatic, , Chartname)
.Publish (True)
.AutoRepublish = False
End With
Next j
End Sub

jeff
-----Original Message-----
I have about 500 graphs I need to load to the web and
they are updated every week. I save them as html files
and then grab the images and toss them into front page.
The problem is that some of the graphs are not reported
every week. Right now, I have a hyperlink pointing to
image 034, but since it didn't report this week, it is
pointing to the wrong image. This causes a big problem
with all the hyperlinks pointing to the wrong charts.
What I would like to do is save the excel graphs
according to their excel worksheet name. The graphs are
all on their own worksheet and the worksheets are named
how I would like the images to be saved. Is it possible
to save as an HTML file so that the image files are named
after the worksheet name?
 
Top