View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Please help debug this macro.

You are not using the return value (there is not one in fact, as it's a sub)
nor evaluating the argument (true).
So you do not require the brackets:
..Publish True

NickHK

"dd" <dd.dd wrote in message
...
I'm trying to set up a macro to save the selected print area as a single
file web page, but I get an error at .Publish (True) "Runtime error 1004
Application-defined or object-defined error."

Private Sub cmdSave_Click()
With ActiveWorkbook.PublishObjects.Add(xlSourcePrintAre a, _
"P:\GBGWA\Rail\Jobs\5048337 OPI06\Surveys\Index of Proforma
Files.mht", "List1" _
, "", xlHtmlStatic, "Proforma Index (pfm files)_27036", "")
.Publish (True)
.AutoRepublish = False
End With


End Sub

D Dawson