code to save as webpage

R

Ryan

is there a way to have code run in a macro to automatically save a
chart / or workbook as a webpage?

Thanks!

Ryan
 
M

Mark Ivey

Give this one a try:

'---------------------------------------------------------------------------------------
' Module : SaveAsHTML
' DateTime : 6/19/2007 22:34
' Author : Mark Ivey - Modification from Dave Hawley's SaveAsPrompt
Module @
' http://www.ozgrid.com/forum/showthread.php?p=312642
' Purpose : To automatically save a file as an HTML Webpage (without
overwrite prompt)
'---------------------------------------------------------------------------------------

Sub SaveAsHTML()
Dim StrSave As String
'Change the path and filename as desired
StrSave = "C:\MyFile2"

If StrSave = "False" Then
Exit Sub
Else
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs StrSave, FileFormat:=xlHtml
Application.DisplayAlerts = True
End If
End Sub
 

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