|
Save a workbook as HTML (web
page)
without interactivity.
Sub wbSaveAsHTML()
Dim wb As Workbook
Set wb = ActiveWorkbook
'Do what you want with workbook here, using wb
variable
'Then save the workbook as an html document
wb.SaveAs Filename:="C:\myWebPage.htm",
FileFormat:=xlHtml
End Sub
Save a workbook range (A1:A6)
as a HTML (web page) without
interactivity.
Sub wbRangeAsWeb()
Dim wb As Workbook
Set wb = ActiveWorkbook
'Do what you want with workbook here, using wb
variable
'Then save the range A1:C6 as an html document
without interactivity
With wb.PublishObjects.Add(xlSourceRange, _
"C:\myPage.htm", "Sheet1", "$A$1:$C$6", _
xlHtmlStatic, "Book1_20936")
.Publish (True)
End With
End Sub
Save a workbook range (A1:A6)
as a web component with interactivity.
(Note the change from xlHtmlStatic (above) to
xlHtmlCalc (Below). This adds the interactivity.
Sub wbRangeAsDynamicWeb()
Dim wb As Workbook
Set wb = ActiveWorkbook
'Do what you want with workbook here, using wb
variable
'Then save the range A1:C6 as an web component
with interactivity
With wb.PublishObjects.Add(xlSourceRange, _
"C:\myPage.htm", "Sheet1", "$A$1:$C$6", _
xlHtmlCalc, "Book1_20936")
.Publish (True)
End With
End Sub |