Save as webpage

  • Thread starter Thread starter daniels012
  • Start date Start date
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
 
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", "",
 
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
 
Back
Top