Professional Documents
Culture Documents
Excel To HTML
Excel To HTML
String
Worksheets(SheetName).Activate
iColumn = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
iRow = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
StartAddress = "A1"
EndAddress = Application.ConvertFormula(Range(Cells(iRow,
iColumn).Address).Address, xlA1, xlA1, 4)
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _
FileName:=outputFileName, Sheet:=sheetName, Source:=dataRange, _
HtmlType:=xlHtmlStatic, DivID:="Book1_4170")
.Publish (True)
.AutoRepublish = False
End With
Done:
Exit Function
ErrHandler:
ExcelToHTMLFile = "An Error occured while generating HTML file " &
vbNewLine & "Error Type: " & Err.Description
End Function