Save as webpage

D

daniels012

I have created a button to save my spreadsheet as a webpage here is the
code when I hit the button:

ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\WINDOWS\Personal\Emailed Proposals\Page.htm", "FRONT", "",
xlHtmlStatic, _
"Proposal for XL_16777", "").Publish (True)
ChDir "C:\WINDOWS\Personal\Emailed Proposals"
Range("K1").Select

It works great!! The only problem is it saves as the same name
everytime Page.htm. In the Proposal in cell (n2) it has the Proposal
number. I would like to name it using this number. Is there a way to
do this?? If so, what do I need to add to my code?

Something like "Proposal" & Cell(N2)

Any help would be greatly appreciated!
Michael
 
J

jeff

Hi,
Yep, you're on the right track.

replace
"C:\WINDOWS\Personal\Emailed Proposals\Page.htm",
with
"C:\WINDOWS\Personal\Emailed Proposals\Proposal " & N2
& ".htm",

jeff
-----Original Message-----
I have created a button to save my spreadsheet as a webpage here is the
code when I hit the button:

ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\WINDOWS\Personal\Emailed
Proposals\Page.htm", "FRONT", "",
 
D

daniels012

It kept giving me a misiing seperator error. I used some code I ha
from another button and it seemed to work.
The code is:
Proposal" & _
Str(Application.Range("N2").Value)

That seemed to do the trick!

Thank You,
Michae
 

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