ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Publish active sheet as static web page (https://www.excelbanter.com/excel-programming/336052-publish-active-sheet-static-web-page.html)

Stellina

Publish active sheet as static web page
 

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(xlSourcePrintAre a, _
"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

--
Stellin
-----------------------------------------------------------------------
Stellina's Profile: http://www.excelforum.com/member.php...fo&userid=2578
View this thread: http://www.excelforum.com/showthread.php?threadid=39186


Stellina[_2_]

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


Stellina[_3_]

Publish active sheet as static web page
 

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

--
Stellin
-----------------------------------------------------------------------
Stellina's Profile: http://www.excelforum.com/member.php...fo&userid=2578
View this thread: http://www.excelforum.com/showthread.php?threadid=39186



All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com