reader6886
New Member
- Joined
- Sep 10, 2020
- Messages
- 25
- Office Version
- 2019
- Platform
- Windows
I created a simple macros to save excel file as webpage.I would like to make that macros possible to use for file with different names too without manually having to change the name for every different workbook/files . What and where do I change below so that macros saves the excel file as html with whatever the workbook file name was? I tried using ActiveWorkBook.name in place of mov2.htm but it didnot work.
VBA Code:
Sub tohtml()
' tohtml Macro
With ActiveWorkbook.PublishObjects.Add(xlSourceWorkbook, _
"C:\path\path\path\mov2.htm", , , xlHtmlStatic, "mov2_16832", "")
.Publish (True)
.AutoRepublish = True
End With
End Sub