Save As Web Page Automation Help
Please be kind, I'm just starting to learn to program
Excel. I've tried automating the "save as web page" process by recording a macro, but it's not working. I would like to place a button on the worksheet so that a press of the button will save it as a web page to a defined location/filename. I have everything ready to go, except the code. Recording macros didn't help. Thx |
Save As Web Page Automation Help
Hi Steve
Try this to save the activesheet as a htm file Sub test() Dim sName As String sName = "C:\test.htm" ActiveWorkbook.PublishObjects.Add( _ SourceType:=xlSourceRange, _ Filename:=sName, _ Sheet:=ActiveSheet.Name, _ Source:=ActiveSheet.UsedRange.Address, _ HtmlType:=xlHtmlStatic).Publish End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Steve" wrote in message ... Please be kind, I'm just starting to learn to program Excel. I've tried automating the "save as web page" process by recording a macro, but it's not working. I would like to place a button on the worksheet so that a press of the button will save it as a web page to a defined location/filename. I have everything ready to go, except the code. Recording macros didn't help. Thx |
Save As Web Page Automation Help
"Ron de Bruin" wrote: Hi Steve Try this to save the activesheet as a htm file Sub test() Dim sName As String sName = "C:\test.htm" ActiveWorkbook.PublishObjects.Add( _ SourceType:=xlSourceRange, _ Filename:=sName, _ Sheet:=ActiveSheet.Name, _ Source:=ActiveSheet.UsedRange.Address, _ HtmlType:=xlHtmlStatic).Publish End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Steve" wrote in message ... Please be kind, I'm just starting to learn to program Excel. I've tried automating the "save as web page" process by recording a macro, but it's not working. I would like to place a button on the worksheet so that a press of the button will save it as a web page to a defined location/filename. I have everything ready to go, except the code. Recording macros didn't help. Thx |
All times are GMT +1. The time now is 02:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com