Save in location button

Hello all

This is how my button is programmed...

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------


Private Sub UserForm_Initialize()
    Me.TextBox1.Text = Date
End Sub

Private Sub CommandButton1_Click()
    MyPath = "\\tprc1fanp001\shared\Enforcement, Enquiry & Complaints\Manual
Payment History\"                 'Set the Path
    MyFileName = "Date" & Me.TextBox1.Text & ".xls"    'Create the File Name
    MySaveString = MyPath & MyFileName   'String the two together

ActiveWorkbook.SaveAs Filename:=MySaveString, FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------
This is my error message:



Run Time Error '1004':
Microsoft Excel cannot access the file '\\tprc1fanp001\shared\Enforcement,
Enquiry & Complaints\Manual Payment History\Date06\02' There are several
possible reasons:
-The file name or path name does not exist
-The file you're trying to open is being used by another program.

Close the document in the other program, and try again

End or Debug

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------

Why is file attempting to save as Date06\02?

Thank you in advanced



0
ravisandhu (10)
2/6/2004 9:37:04 PM
excel 39879 articles. 2 followers. Follow

2 Replies
455 Views

Similar Articles

[PageSpeed] 37

A slash is not a valid file name character.  I'd suggest you generate the
date string with something like this:

format(now,"ddmmyy")

-- 
Jim Rech
Excel MVP


0
jrrech (1933)
2/6/2004 9:47:30 PM
Hyphens and underscores are valid.  Underscores get hidden if hyperlinks
are involved.   But would certainly suggest using  four digit year and
placing  year before month before day of month,  so you can sort
on filename when looking at a directory.     i.e.
      format(now(),"yyyy-mm-dd")    -or-
      format(now(),"yyyy_mmdd")
---
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/dmcritchie/excel/search.htm

"Jim Rech" <jrrech@hotmail.com> wrote in message news:eZCmQrP7DHA.2404@TK2MSFTNGP11.phx.gbl...
> A slash is not a valid file name character.  I'd suggest you generate the
> date string with something like this:
>
> format(now,"ddmmyy")



0
dmcritchie (2586)
2/6/2004 10:28:20 PM
Reply:

Similar Artilces:

How do I Click a Command Button on another protected spreadsheet from mine?
I need to copy information from my spreadsheet to another 3rd party protected spreadsheet and Click a Command Button on it, and then the Start button when it appears. And then maybe enter info into a login screen if I'm not connected to the internet, because it goes to a Government site to return information into the spreadsheet. Is there any way of doing this? Thanks now for any help. ...

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...

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...

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#...

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! ...

Outlook 2k3 no dial location
I have one Windows XP client that I just installed Outlook 2003 on. Of 60 or more that I have done none has had this problem. When working offline and pressing F9 the send/receive dialog box comes up correctly. It is followed by the logon dialog box as it should. The problem is that the logon dialog box is missing the list boxes for the phone number to dial as well as the dial location. I haven't seen anything that would turn this feature on or off. Detect and repair had no effect. The user can still make the settings changes from "Tools --> Send/Receive" so he's not dead...

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...

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...

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...

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...

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...

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...

Move page button on sidenote
If you want to move a side note to one of your onenote pages, the easiest way is to customize your toolbar to add the "Move Page to" button to the sidenote toolbar. 1- select the drop down at the end of the toolbar 2- Select Add remove buttons and Customize 3- Under commands in the popup windows, select Edit - move page to - button to your toolbar. ...

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...

How to get saved old saved work that was saved over?
I typed up some History notes and saved it. I wanted to use the same format from those History notes for some new History notes and I saved over on my old work. How can i retrive my old saved work? My work was in Word not Excel But I could not find a place to ask a question in the Word help section. If you saved over the original file, it is gone forever. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Maral" <Maral@discussions.microsoft.com> wrote in message news:C0ADFEF9-6A46-4589-8923-4BFC07D9C61F@microsoft.com......

Restricting activation of a form button
I'm using 2 form buttons which runs 2 different subs. The buttons are on the same sheet. I wish to restrict the activation of one of the 2 buttons (assigned to the sub below) to only authorised persons via say, a password prompt? which appears upon clicking the button. Grateful for an example or two of how this control could be done. Thanks Sub TestReset() Sheet8.Select Range("D10").Value = Range("G15").Value Range("D11").Value = Range("D15").Value End Sub I would try something like this: Sub TestRest() Sheet8.Select Dim...

control recording saving
I designing a form the feilds are bound. the form will be used by other workers i want the form to update records using a update button but if the user enters data and then decides that they don't want to update the information. hqw can i prevent the update of the information entered on the form when the user closes the form using the close button "904allen" <904allen@discussions.microsoft.com> wrote > I designing a form the feilds are bound. the form will > be used by other workers i want the form to update > records using a update button but if the user ...

auto save email address's
In outlook 2007, how do I set it to auto save email address's that I send out? No full versions of Outlook ever had the ability to add recipients automatically to your Contacts Folder. Only the long abandoned IMO mode of Outlook 98/2000 did that. To automatically add the email address of people you respond to to your Contacts Folder requires code: http://www.outlookcode.com/d/code/autoaddrecip.htm http://www.slipstick.com/contacts/addauto.htm -- Russ Valentine [MVP-Outlook] "Johnfli" <john@ivhs.us> wrote in message news:%23t7Bb82DIHA.1164@TK2MSFTNGP02.phx.gbl... &g...

Check for valid file name before saving
My form copies a file from one locatin, prompts the user to create a new name for the file, then saves the file to another location. is there an easy way to ensure the user has entered a valid file name (e.g. did not use '/' or "^" or anything like that) so the save does not fail? OR, would it be easier to some how set up error handling so that if the save fails for that reason, i can prompt the user to try again. How would i do either of these things? Thanks, You must use error handling for this kind of operation, as there are just too many things that could go wrong....

Transfer from Checking into Savings account...
OK all, Now I'm really confused. I'm using M05 Deluxe and I set up an ING Direct savings account. I transfered $20.00 into the ING account from checking but when I look at the ING savings account register, it shows a poitive Decrease of 20.00 and a balance of (20.00). As if I owe 20.00 to ING. However, when I click on the Home tab, it shows that ING has a positive amount of $20.00. What gives? Am I doing something wrong or is this how it's supposed to be? Thanks, Steve Essential Register and/or downloaded transaction data? What type of Money Account is the ING Savings ...

Option Buttons on a spreadsheet
Is there a limit to the number of option buttons I can insert into a group. If I am using the cell link and then creating an IF formula based on the result does this have an impact? Thank you in advance. Kind regards Ann, Dublin, Ireland There may be but, if so, it would be a large number that none of us have run into. I'd guess that you would achieve an ungainly and awkward interface well before you hit any limit. -- Jim "Ann Shaw" <anncshaw@yahoo.com> wrote in message news:047e01c54b29$7d2fe3c0$a401280a@phx.gbl... > Is there a limit to the number of opti...

Save All...
Excel 2002 SP3 Win XP Pro SP2 Hi, Is there a way to do a Save All (all opened files) in a similar fashion as clicking Shift|File|Close All ? Failing that, any macros out there I could use? Thanks a million! Here is one I use to save and close all opened files including the file housing the macro and leaving excel. Sub CLOSE_ALL() Application.ScreenUpdating = False Application.DisplayAlerts = False For Each w In Application.Workbooks If w.Name <> ThisWorkbook.Name Then w.Save w.Close ' w.Close SaveChanges:=True 'MsgBox w.Name End If Next w ThisWorkbook.Save Applicati...