Periodically exporting worksheet to HTML

  • Thread starter Thread starter SupportX
  • Start date Start date
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.
 
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)
 
Back
Top