ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to save range as a HTML fife (https://www.excelbanter.com/excel-programming/276537-vba-save-range-html-fife.html)

Brian Lahti

VBA to save range as a HTML fife
 
It is a simple matter to manually save any part of a
spreadsheet at a .htm file. When I macro record the
process the code doesn't work in a command button.
Does anyone know of a VBA code to perform this?

Thanks

Brian

Dick Kusleika

VBA to save range as a HTML fife
 
Brian

If you are using a command button from the Control Toolbox, see if changing
the TakeFocusOnClick property makes a difference.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Brian Lahti" wrote in message
...
Thanks for the reply!

I found that I have to have my code in the command button
select a cell on the spreadsheet for the "PublishObjects"
methods to work. Something like Range(a6).select ...

It took awhile to figure out but the code would run from a
macro but not from a VBE sub w/o the "Range(a6).Select".

Thanks

Brian


-----Original Message-----
Brian

See the Add method of the PublishObjects collection. Use

the PublishObjects
property of the Workbook object, such as

ThisWorkbook.PublishObjects.Add etc..

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Brian Lahti" wrote in message
...
It is a simple matter to manually save any part of a
spreadsheet at a .htm file. When I macro record the
process the code doesn't work in a command button.
Does anyone know of a VBA code to perform this?

Thanks

Brian



.





All times are GMT +1. The time now is 05:16 PM.

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