SaveAs HTML

R

RM

I am using late binding to invoke Excel to open a workbook and then save it
as an HTMl document. I would like to know what the value for the fileformat
parameter should be to save the workbook as a single file web page ?

Thanks,

RM
 
S

Steve Rindsberg

I am using late binding to invoke Excel to open a workbook and then save it
as an HTMl document. I would like to know what the value for the fileformat
parameter should be to save the workbook as a single file web page ?

Record a macro while you save a workbook to single file HTML.

Result ...
FileFormat:=xlWebArchive
Debug.Print xlWebArchive
45

Annoying that the help files and MSDN give you the names but never the values
of the constants, isn't it?
 
R

RM

Record a macro while you save a workbook to single file HTML.

Result ...
FileFormat:=xlWebArchive
Debug.Print xlWebArchive
45
Thanks - useful tip. Is there something special I need to do to open this
file in IE ?
Annoying that the help files and MSDN give you the names but never the values
of the constants, isn't it?
Absolutely - I am trying to avoid using the constants by name as they need
to be compiled in an environment that may not have the PIA loaded on it.
 
S

Steve Rindsberg

Thanks - useful tip. Is there something special I need to do to open this
file in IE ?

I'm a PowerPoint geek. We just overflowed my Excel Knowledge Thimble in
finding the constant values. ;-)

But if it's anything like PPT's MHT files, no, nothing special. Doubleclick it
or drag it into an Explorer window.
Absolutely - I am trying to avoid using the constants by name as they need
to be compiled in an environment that may not have the PIA loaded on it.

I'll sometimes define my own constants with the same values as the ones I need
(usually give them a unique prefix so the compiler and I know we're not trying
to talk to the real ones)
 
R

RM

But if it's anything like PPT's MHT files, no, nothing special. Doubleclick it
or drag it into an Explorer window.

Thanks for your help. I was giving the file a .htm extension and this
caused it to be opened incorrectly in IE. Using the .mht or .mhtl
extensions works great.
I'll sometimes define my own constants with the same values as the ones I need
(usually give them a unique prefix so the compiler and I know we're not trying
to talk to the real ones)
Thaat is what I did too. This way the users of the library know what my
intent is.

RM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top