ntupper
07-13-2010, 07:18 AM
Is it possible to export to html without using save as? I am trying to add in some dynamic reporting in the form of a pie chart to an active sheet that I use quite frequently. Rather than keep re-issuing the report I would like to export it to HTML so that it can be viewed at will. The only problem I have is that the only way I have managed to get it working is by using the Save As function - this causes issues because it obviously changes the excel sheet to an HTML file but it needs to refresh every minute or so. Is there another way? My current code is below;
Sub RefreshData()
ActiveWorkbook.Save
Call SaveIt
Call SaveToSharepoint
End Sub
Sub SaveIt()
ThisWorkbook.Save
Application.OnTime Now + TimeSerial(0, 1, 0), "SaveIt"
End Sub
Sub SaveToSharepoint()
'Autosaves to sharepoint for management reporting
ActiveWorkbook.SaveAs Filename:= _
"XXXXreport.htm" _
, FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False
Sub RefreshData()
ActiveWorkbook.Save
Call SaveIt
Call SaveToSharepoint
End Sub
Sub SaveIt()
ThisWorkbook.Save
Application.OnTime Now + TimeSerial(0, 1, 0), "SaveIt"
End Sub
Sub SaveToSharepoint()
'Autosaves to sharepoint for management reporting
ActiveWorkbook.SaveAs Filename:= _
"XXXXreport.htm" _
, FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False