If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Save as

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-19-04, 12:10
surfacesys surfacesys is offline
Registered User
 
Join Date: Mar 2004
Location: Greenville, SC
Posts: 271
Save as

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 my 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
__________________
Gotta to do some code
Reply With Quote
  #2 (permalink)  
Old 08-19-04, 21:30
savbill savbill is offline
Registered User
 
Join Date: Feb 2004
Posts: 533
Create a variable with your desired name and Save path use this in the PublishObjects Statement.

Dim strPath as string
Dim strPName as String

' "Proposal" & Cell(N2)
strPath = "C:\WINDOWS\Personal\Emailed Proposals\"
strPName = strPath & "Proposal" & ActiveSheet.Cells(2, 14)

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

Bill
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On