Answer the question
In order to leave comments, you need to log in
How to save .xlsx to web page format with a macro?
There is an .xlsx file that needs to be saved as a web page (.htm and a .files folder).
It is desirable to automate the process - when opening a file, a macro is triggered and saved in the required format, closes the file.
If you tell me how to make it work without opening a file at a certain time, once a day it will be very cool.
What is already there, collected in the corners of the Internet:
' Automatically run a macro when opening a document
Sub Auto_Open()
HTM
End Sub
' Automatically save as a web page
Sub HTM()
' Document directory
ChDir "C:\Grafik"
' Directory for saving in web page format
ActiveWorkbook.SaveAs Filename:="C:\Grafik\Grafik.htm", _
FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
' Automatically close the document after
Sub Auto_Close()
Application.Quit
ActiveWorkbook macro is executed. Close True
End Sub
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question