Periodically exporting worksheet to HTML

S

SupportX

Subject: Periodically exporting worksheet to HTML

Hi,

I am new to Excel, and have the following question:

Is there a way to have Excel export the worksheet to HTML at an interval of X minutes. I have a sheet that keeps getting modified by certain calculation and auto-data input and I need to dump it every X minutes to a Web-accesible HTML file.

Thanks,

SupportX.
 
N

Nick Hodge

Supportx

You can use the Ontime method for this. the code below will run the output
to HTML every one minute to a different file name. You can change the file
locations, etc to suit. It can also have a latest time to run so it shuts
off automatically. If you add some more code to the Workbook_open event it
will start itself when the file is opened.

Dim iCnt As Integer

Sub TimeTrigger()
Application.OnTime Now + TimeValue("00:01:00"), "ExportToHTML"
End Sub

Sub ExportToHTML()
ActiveSheet.SaveAs Filename:="C:\File" & iCnt & ".htm", _
FileFormat:=xlHtml
iCnt = iCnt + 1
TimeTrigger
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top