View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default 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