Save as .htm with filename from cell

I have a macro to save a sheet as an htm file.  I can specify a name
for the file.  Is there a way to use the contents of a cell for the
file name?  Thanks for any and all help.


0
5/13/2005 2:08:12 AM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
414 Views

Similar Articles

[PageSpeed] 16

As long as the values in the cell do not contain forbidden characters, you 
could simply reference the cell when saving the file using 
range("cell_containing_name").value
-- 
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"agentcooter@pobox.com" wrote:

> I have a macro to save a sheet as an htm file.  I can specify a name
> for the file.  Is there a way to use the contents of a cell for the
> file name?  Thanks for any and all help.
> 
> 
> 
0
galimi (74)
5/13/2005 2:45:06 AM
What about publishing just one sheet as an htm file.  My macro looks
like this now.  I used Record Macro to get it.  I don't know what all
those words mean in the macro.  But I would like to be able to use the
contents of cell N131 as the filename.  Thanks.

>     Option Private Module
>     Sub ExportFinal()
>     '
>     ' ExportFinal Macro
>     ' Macro recorded 4/29/2005 by
>     '
>         With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
>             "C:\Documents and Settings\HP_Administrator\Desktop\Copy of cooter\calhDATE.htm" _
>             , "web (2)", "", xlHtmlStatic, "horses_17286", "")
>             .Publish (True)
>             .AutoRepublish = False
>         End With
>         
>         Sheets("web (2)").Select
>         Application.DisplayAlerts = False
>         ActiveWindow.SelectedSheets.Delete
>         Application.DisplayAlerts = True
>         Sheets("CALENDAR").Select
>         
>     End Sub

On Thu, 12 May 2005 19:45:06 -0700, galimi
<galimi@discussions.microsoft.com> wrote:

>As long as the values in the cell do not contain forbidden characters, you 
>could simply reference the cell when saving the file using 
>range("cell_containing_name").value
>-- 
>http://HelpExcel.com
>1-888-INGENIO
>1-888-464-3646
>x0197758
>
>
>"agentcooter@pobox.com" wrote:
>
>> I have a macro to save a sheet as an htm file.  I can specify a name
>> for the file.  Is there a way to use the contents of a cell for the
>> file name?  Thanks for any and all help.

0
5/13/2005 3:34:45 AM
Change the following line

"C:\Documents and Settings\HP_Administrator\Desktop\Copy of 
cooter\calhDATE.htm", "web (2)", "", xlHtmlStatic, "horses_17286", "")

"C:\Documents and Settings\HP_Administrator\Desktop\Copy of cooter\" & 
range("N131").value, "web (2)", "", xlHtmlStatic, "horses_17286", "")


-- 
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"agentcooter@pobox.com" wrote:

> What about publishing just one sheet as an htm file.  My macro looks
> like this now.  I used Record Macro to get it.  I don't know what all
> those words mean in the macro.  But I would like to be able to use the
> contents of cell N131 as the filename.  Thanks.
> 
> >     Option Private Module
> >     Sub ExportFinal()
> >     '
> >     ' ExportFinal Macro
> >     ' Macro recorded 4/29/2005 by
> >     '
> >         With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
> >             "C:\Documents and Settings\HP_Administrator\Desktop\Copy of cooter\calhDATE.htm" _
> >             , "web (2)", "", xlHtmlStatic, "horses_17286", "")
> >             .Publish (True)
> >             .AutoRepublish = False
> >         End With
> >         
> >         Sheets("web (2)").Select
> >         Application.DisplayAlerts = False
> >         ActiveWindow.SelectedSheets.Delete
> >         Application.DisplayAlerts = True
> >         Sheets("CALENDAR").Select
> >         
> >     End Sub
> 
> On Thu, 12 May 2005 19:45:06 -0700, galimi
> <galimi@discussions.microsoft.com> wrote:
> 
> >As long as the values in the cell do not contain forbidden characters, you 
> >could simply reference the cell when saving the file using 
> >range("cell_containing_name").value
> >-- 
> >http://HelpExcel.com
> >1-888-INGENIO
> >1-888-464-3646
> >x0197758
> >
> >
> >"agentcooter@pobox.com" wrote:
> >
> >> I have a macro to save a sheet as an htm file.  I can specify a name
> >> for the file.  Is there a way to use the contents of a cell for the
> >> file name?  Thanks for any and all help.
> 
> 
0
galimi (74)
5/13/2005 3:51:01 AM
Thanks galimi.  That did the trick.

On Thu, 12 May 2005 20:51:01 -0700, galimi
<galimi@discussions.microsoft.com> wrote:

>Change the following line
>
>"C:\Documents and Settings\HP_Administrator\Desktop\Copy of 
>cooter\calhDATE.htm", "web (2)", "", xlHtmlStatic, "horses_17286", "")
>
>"C:\Documents and Settings\HP_Administrator\Desktop\Copy of cooter\" & 
>range("N131").value, "web (2)", "", xlHtmlStatic, "horses_17286", "")

0
5/13/2005 4:37:16 AM
Reply:

Similar Artilces:

FileNotFound returned by Bitmap::Save() when saving to stream
I have a little chunk of code which is supposed to take a bitmap image and save its PNG encoding into a block of memory. The problem is, I keep getting a FileNotFound error back from Save(). If anyone has any ideas, I'd love to hear them. Here's the code (more or less) in question; there really shouldn't be much to it, I would have thought: /* Allocate an IStream object to write the data into a global memory block. We indicate that the handle to the underlying data will be freed when the stream object is released. */ VERIFY(S_OK == ::CreateStreamOnHGlobal(nil, True, static_c...

Handling of savings accounts and 401k accounts in the budget
I noticed that Money treats money that I contribute to a 401k account or transfer to a savings account as an expense. Basically, the more I contribute, the worse my budget looks. Is there a way to prevent this from happening? Right now, I exclude transfers to my savings account from the budget and it solves the problem, however, I shouldn't have to manually do this each time. For 401k contributions, I cannot find a way to do this. Why does it show up as "an expense" (what Category???) instead of something like Transfer Out of Budget Accounts? The 401k cash account sh...

if a cell has a value greater than 0, then atomaticaly goto a seperate page for addit
Dear Help forum, I'm trying to set up a formula that will automatically move me t another sheet if a value greater than 0 is entered in certin cells. Thank you Fran -- Franks ----------------------------------------------------------------------- Frankso's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3011 View this thread: http://www.excelforum.com/showthread.php?threadid=49797 A formula returns a value to the cell that holds it. It can't move you. But maybe you could use a =hyperlink() formula that would allow you to click the link and go to the ...

Protecting certain cells
I am using formulas to get averages , standard deviation and other figurers... I want to be able to lock the cell so others cannot change my formula but be able to change certain values to get averages and other information .... I was trying to use the protection under tools to no hope... any help would be appreciated -- In Excel, cells are either locked or unlocked; the default is locked. If a worksheet is not protected, there is no difference in behavior, but if you protect the worksheet, the locked cells are protected, but the unlocked cells can be edited. What you need to d...

what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document?
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel wrote: > what encoding does system.xml.xmldocument.save(string path) use to save the > xml document if there is no <?xml... in the front of the xml document? UTF-8 is the default encoding. -- Oleg Tkachenko [XML MVP, MCPD] http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net utf8 i suppose would be default Vinu Baby "Daniel" <softwareengineer98037@yahoo.com> wrote in message news:e8#...

Unable to save password in Outlook 2003
I cannot seem to save my "network password" for Outlook 2003. I tried everything I can think of. I tried editing the registry. I use XP. I try going into Control Panel, go to mail and go thru the process there and....nothing worked there. I uninstalled Office the reinstalled it.....nothing! I even went as far as unistalling my internet software, still...nothing! Someone told me that XP will not save passwords. My Outlook express works fine. Someone HELP! I also had this issue in Outlook 2003, but also in indows Live Messenger and Internet Explorer 7. I spend hour...

Save and save as
Hi, I am looking for some help with a macro, I need to disable anyone from saving a file or save as and also disable the prompt if the close button is pressed you get an option to save the file then, I need to disable all of these, also have a pop up box to warn that save as been disables when a user tries to save the file fro save and save as. Can anyone help me with this. I am using word 2003 Regards Mark Once you give someone access to a document, you have ceded all control over it. You can however stop them from overwriting the original file by making the doc...

Saving Images
When I right click to save an image in an email, it will only save as a .bmp. I need to use it as a .jpeg or a .gif. How can I fix this? In news:AB8040CE-5975-4A14-87BD-BE3B97E33682@microsoft.com, Angi <Angi@discussions.microsoft.com> typed: > When I right click to save an image in an email, it will only save as > a .bmp. I need to use it as a .jpeg or a .gif. How can I fix this? Clear your internet explorer temp file cache.....go to control panel, internet options, and choose 'delete files' "Angi" <Angi@discussions.microsoft.com> wrote in message...

"Unattainable" savings goals
I've learned to mostly ignore it, but it drives me batty. I have a particular loan with a goal to pay it off by 7/4/04. The loan balance is 14,000. I have marked a savings account to be "used for budgeted savings goals." I deposit $1300 per month into the account which has a balance currently of $13000. Money 2K4 says that I cannot reach my savings goal. What can I do to help fix this? Any feedback would be appreciated! ...

Hyperlink to cell and have it appear at top upper left hand corner
I am new user. I have created 3 worksheets and defined names for certain cells. I have then created hyperlinks for those cells to go to other named cells. My problem is that when I click on the hyperlinked cell, Excel goes to the correct cell but I would like to have it appear at the top left corner of the spreadsheet. It instead might appear at the middle or right hand side of the spreadsheet. What can I do to correct this? Thank you in advance for anyones response. There must be a better way, but I would programatically check the left & top values of the cell and move a te...

Saving default tabs
I can't seem to get a change in the default tab setting to save. When I reopen publisher the tab setting reverts to .5 which was original default. I'm I the only person who is having this problem? I'm using the 2003 verson but had the same problem with 2000. Why not take the default page, set the tabs you want and save it as a template with a file name of, "My Very Special Tabs Settings for Future Files.pub" (jerking your chain a bit<G>) Then when you want to create what you want, use your created template file and when your pub file is what you want, do a Sa...

count cells that have *text1* and don't have *text2*
I have a column of text cells (each with different number of words), And need to count those cells which meets the following conditions: They have the text “box” and don’t have the text “not” in them. For example: “White boxes not present “-> should not be counted “Boxes cover” -> should be counted. Thanks Try... =SUMPRODUCT(--(ISNUMBER(SEARCH("box",A1:A10))),--(1-ISNUMBER(SEARCH("not" ,A1:A10)))) Hope this helps! In article <E7630349-9CEE-4F28-B8FF-DF0C650E7096@microsoft.com>, amntre <amntre@discussions.micros...

copy different cells from 1 sheet to another
Is there a way to copy a range of non adjasent cells from one sheet to another without moving back and forth between the 2 sheets? i.e. copy D15 from sheet1 to K17 in sheet2 copy G10 from sheet1 to M17 in sheet2 copy range starting E21 until first empty line from sheet1 to colomn I in sheet2 starting the first empty line in that colomn. copy range starting C21 until first empty line from sheet1 to colomn F in sheet2 starting the first empty line in that colomn. try this Sub copyshttosht()'from source sheet With Sheets("DestinationSheetName") range("D15").copy .ran...

Can you make a cell with a diagonal, so that you can edit the upper and lower part of the cell?
If you make a square cell, then make a diagonal border you can make it look right for printing, but I was wondering if there is anyway to make it so that you can edit. For example: I would like to make a cell and then split it into 2 cells, so that it will almost look like a fraction. 1/2 #1 in the upper cell,# 2 in the lower cell, then use a border to do the diagonal. gwillis G, Not really. But you can take two side-by-side cells, format them so that their text is on a 45 degree angle, put a vertical border between them, and then adjust the row heights and column widths to get some...

Save to unProtect a Document?
Our company has word documents that we use as templates on a fileserver. How could I protect the documents so that when they open them, they dont make changes to the server version, but save their OWN version and do what they want? First of all, make use of true *template* files (with the *.dot or *.dotx extension). Also, assign the template files the read-ony attribute. -- Stefan Blom Microsoft Word MVP "Chris" <Chris@discussions.microsoft.com> wrote in message news:EB9D352D-823F-4126-8A00-2D90516A3FA1@microsoft.com... > Our company has word docum...

when I save an email, where does it save to?
Hi all, I have several emails that I wanted to reply, and I did click "reply" and then wrote something, but I did not have time to finish... then I click on "save", and in the evening, I closed the outlook because I slept... now I reopen the outlook in the morning, and I want to find my saved unfinished replies that I was writing... But where to find them? I have a "draft" folder, but those saved emails do not seem to be in this folder... wherelse could they go? ---------------------------------------------- This is annoying... is there a way to automat...

Counting Cells #2
How can I tally values in different cells that do no fall into a specific range. For example, I would like to tally all the values in E2,I2, L2, and P2 which meets a certain criteria such as containing the number "3". While these numbers do fall into the range C2:R2, I don't want all the values for the other cells which I am not interested in. So, how can get excel to isolate the cells that I am interested in and giving me a value? =SUMPRODUCT(--(LARGE(NCrange,ROW(INDIRECT("1:"&COUNT(NCrange))))=3)) where NCrange refers to: =Sheet1!$E$2,Sheet1!$I$2,Sheet1...

Exchange 2007 And Daylight Savings Time Update
Is there a patch I need for Day light savings time and Exchange 2007? Thanks! No CDO patch required (no equivalent of KB 926666). However, the Windows Server 2003 OS will required KB 931836 time zone update and Calendar-items in 2007-hosted mailboxes created using old DST 2006 rules will need to be rebased. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: exchangepedia.com/blog ---------------------------------------------- "D303M" <D303M@discussions.microsoft.com> wrote in message news:A3132ABD-4614-402F-9654-61EA72501112@microsoft.com... > I...

Save csv format to dbf format
I have a .csv file with 13 columns of data opened in excel. I make a few changes to a field and then want to save to .dbf format. After saving as .dbf when I open the file only column 1 data is present. Any insights into where the rest of the data goes? Why does the data disappear? Thanks, Mike -- mdelasaux ------------------------------------------------------------------------ mdelasaux's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28889 View this thread: http://www.excelforum.com/showthread.php?threadid=486365 Try using Notepad and open your .dbf...

How do you keep a comment close to the cell it relates to in Exce.
I added comments to an excel sheet and then added many rows and moved things around. Now my comments are all over the place, I wish to keep them a certain distance in relation to the cell, is there anything I can do. I'm not sure you can control this. But you can move them back to where they belong by using some code at Debra Dalgleish's site: http://www.contextures.com/xlcomments03.html#Reset EHN wrote: > > I added comments to an excel sheet and then added many rows and moved things > around. Now my comments are all over the place, I wish to keep them a > certain d...

Can insert digital ink into Excel cell or a cell comment?
I would like to attach small hand-drawn graphs or formulas to particular cells in Excel. I notice that if you copy an image to Excel, it's not attached to the underlying cells. Is is possible to insert an image (i.e. a hand-drawn graph or formula) into a cell comment? Thanks! Yes, take a look at... http://www.contextures.com/xlVideos01.html#CommentPicture -- Jim Cone Portland, Oregon USA http://www.contextures.com/excel-sort-addin.html "Nickbray" <Nickbray@discussions.microsoft.com> wrote in message news:CCEFC095-A46F-4396-B723-BA75CD03F7...

excel cell limited in # chars that can print?
when i type a large string into a cell, the print image (and the actual printer output) cut off the string at some point. is there a way around this (feature?/bug?) thks Evan Hi Evan, Take a look at HELP, index, specifications Turn on word wrap -- format, cells, alignment, wrap text Use some Alt+Enter to extend a limitation that may not have been worded properly. adjust your row height if needed. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcr...

making a cell resize itself to accommodate data
I have an Excel spreadsheet with a cell that I'd like to make, by default, the size of two ordinary cells. I can insert a new row underneath it and then merge that new row with the row I want to make larger but if I do that the cell no longer resizes itself to accommodate data. Some of the existing rows are the size of two or so cells (in terms of height) but, as right clicking on them and going to the Format Cells... option on the resultant menu shows, they're not the result of two merged cells - they're just one cell whose height has been increased. And when you insert data, t...

Daylight Savings Time #2
In regards to DST or better yet XDST, in my windows 2003 domain environment I have the servers and workstations syncing their clock with one of my DCs. The statement has been presented here that since this is the case we should not have to worry about clocks being off by one hour. I do not get the warm and fuzzy with this statement. I feel that if it were that easy it would have been documented as a solution by now. Maybe they are right and I am wrong. Could you give me an explanation why so or why not? Thanks - Any clock synching is done based on UMT/GMT and the locale/timezone o...

Automatic save of all messages from a known contact
Hi, I'd like to store automatically all messages from a known CRM Contact. If for example my customers email-address is somebody@somhow.com, I'd like to store automatically all his emails via the Exchange<->CRM Connector regardless to who they are sent to. Is that possible? regards Juergen Tolksdorf Hi Juergen. My company has a product called Effective Email that does exactly what you are asking for. There is a sync event that gets installed on the users inbox. When emails come in, it checks the senders address against the CRM database, and if a match exists, it creates a...