M
Matt
I am trying to write a macro that will save a copy of all visible sheets in
my workbook as single file webpages - .mht (one .mht file per sheet).
I have written the following which automatically publishes a single file
webpage for the current sheet but I have no idea how to generalise it to work
on all visible sheets. Can anyone Help?
Sub SaveSFWP()
Application.ScreenUpdating = False
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\Documents and Settings\MatthewA\Desktop\" & Range("a1").Text & "
Departure.mht", "Sheet1", "", _
xlHtmlStatic, "Book1_30587", "")
.Publish (True)
.AutoRepublish = False
End With
ChDir "C:\Documents and Settings\MatthewA\Desktop"
End Sub
my workbook as single file webpages - .mht (one .mht file per sheet).
I have written the following which automatically publishes a single file
webpage for the current sheet but I have no idea how to generalise it to work
on all visible sheets. Can anyone Help?
Sub SaveSFWP()
Application.ScreenUpdating = False
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\Documents and Settings\MatthewA\Desktop\" & Range("a1").Text & "
Departure.mht", "Sheet1", "", _
xlHtmlStatic, "Book1_30587", "")
.Publish (True)
.AutoRepublish = False
End With
ChDir "C:\Documents and Settings\MatthewA\Desktop"
End Sub