ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as single file webpage (https://www.excelbanter.com/excel-programming/381337-save-single-file-webpage.html)

dd

Save as single file webpage
 
I have a list of hyperlinked files, which, when saved as a signle file
webpage, the user can right click and save.
The list will become bigger and bigger as work goes on. I want be able to
select the print area and then hit the
save command button to save as a single file web page.

I'e added a save command button to the page and recorded the following macro
to apply to the button, but it doesn't work.

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

I get an error at .Publish (True) "Runtime error 1004 Application-defined or
object-defined error."

Please advise
D Dawson





All times are GMT +1. The time now is 07:31 PM.

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