Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick
I tried this and still get runtime error 1004, Method 'Publish' of object 'PublishObject' failed. I've tried using your instruction with both True and False and there's no difference. I notice when I mouseover the highlighted line it states "True=True" or "Fasle=False". Private Sub cmdSave_Click() With ActiveWorkbook.PublishObjects("Proforma Index (pfm files)_27036") .Publish True .AutoRepublish = False End With End Sub Dylan "NickHK" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Debug Error | Excel Discussion (Misc queries) | |||
Locking debug mode in a macro | Excel Worksheet Functions | |||
how do I debug my Excel macro & make it actually WORK? | Excel Programming | |||
Could someone please debug this short macro for me? I'm stuck! | Excel Programming | |||
Macro Debug | Excel Programming |