View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stellina[_2_] Stellina[_2_] is offline
external usenet poster
 
Posts: 1
Default Publish active sheet as static web page


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


--
Stellina
------------------------------------------------------------------------
Stellina's Profile: http://www.excelforum.com/member.php...o&userid=25784
View this thread: http://www.excelforum.com/showthread...hreadid=391868