ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   code to save as webpage (https://www.excelbanter.com/excel-programming/391630-code-save-webpage.html)

Ryan[_13_]

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

Thanks!

Ryan


Mark Ivey

code to save as webpage
 
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









"Ryan" wrote in message
ps.com...
is there a way to have code run in a macro to automatically save a
chart / or workbook as a webpage?

Thanks!

Ryan





All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com