Publish active sheet as static web page

S

Stellina

When I record a macro for publishing a sheet, I get this:

Sub Macro2()
'
' Macro2 Macro
' Macro to save active sheet as static web page
'
'
With ActiveWorkbook.PublishObjects.Add(xlSourcePrintArea, _
"D:\Documents and Settings\My Documents\Schedule.htm", _
"August", "", xlHtmlStatic, "Schedule_2005_16684", "")
.Publish (True)
.AutoRepublish = False
End With
End Sub

How do I get this to work on the active sheet, regardless of what it'
name is?
The workbook name is Schedule_2005, so what do the numbers after tha
mean?

Thanks for any and all help. I'm lost in this VBA stuff. Stellin
 
S

Stellina

This may be rough, but it works:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/1/2005 to publish active sheet and the next sheet
(to right) as web pages.


With ActiveWorkbook.PublishObjects.Add( _
SourceType:=xlSourceRange, _
Filename:="ftp://mysite.com/Current.htm", _
Sheet:=ActiveSheet.Name, _
Source:="A2:I55", _
HtmlType:=xlHtmlStatic)
Publish (True)
AutoRepublish = False
End With

Dim i As Integer
Dim intStart As Integer

intStart = ActiveSheet.Index + 1

For i = intStart To Worksheets.Count
If Not Worksheets(i).Visible = xlHidden Then
'Note: Could add "and Worksheets(i).Visible = xlVeryHidden to above
Worksheets(i).Activate
Exit Sub
End If
Next i

With ActiveWorkbook.PublishObjects.Add( _
SourceType:=xlSourceRange, _
Filename:= "ftp://mysite.com/Next.htm", _
Sheet:=ActiveSheet.Name, _
Source:="A2:I55", _
HtmlType:=xlHtmlStatic)
Publish (True)
AutoRepublish = False
End With
End Sub
 
S

Stellina

Well, I had this working, but now the second sheet is not publishing.
Does anyone know why?

Is there a way to publish 2 sheets to the same page in a stati
format?

Thanks, Stellin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top