D
D
Danil K.2016-06-23 18:45:17
Macros
Danil K., 2016-06-23 18:45:17

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

1 answer(s)
L
lvv85, 2016-06-24
@lvv85

Create a task in the Windows Scheduler and schedule it to run Daily, Weekly, Monthly, or Once.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question