problems with saving htm files

tassie

Board Regular
Joined
Apr 5, 2004
Messages
179
Hi Guys,


400:
Sheets("html").Select
Range("C1").Select
mylastrow = Range("c65536").End(xlUp).Row
Range("C1:I" & mylastrow + 4).Select
FNAME = store & dept & "s"
With ActiveWorkbook.PublishObjects("supsales_27219")
.Filename = "M:\reports\HTM\" & FNAME & ".htm"
.Publish (False)
End With

500:
Next k
600:
Next i
End Sub

The above code is only writing 12 lines to the htm file when there are mores lines?
A little stumped as to whay as I pickup the last row in a variable and if I stop the code I can see all the lines I've captured.


I just recorded this macro to test further.

Range("C1:G27").Select
ActiveWorkbook.PublishObjects.Add(xlSourceRange, "M:\reports\htm\Page.htm", _
"html", "$C$1:$H$27", xlHtmlStatic, "supsales_18493", "").Publish (True)
Range("C10").Select

I have tried to modify to below code with no luck.
How can I get it to work successfully and also include the mylastrow in the
highlighted line in an effort to make more robust.

mylastrow = Range("c65536").End(xlUp).Row
Range("C1:H" & mylastrow + 4).Select
ActiveWorkbook.PublishObjects.Add(xlSourceRange, "M:\reports\htm\Page.htm", _
"html", "$C$1:$H$27", xlHtmlStatic, "supsales_18493", "").Publish (True)
Range("C10").Select

Any help is apprecated.



Tassie :-(
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,225,847
Messages
6,187,364
Members
453,420
Latest member
ESCH1021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top