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
496 Views

Similar Articles

[PageSpeed] 25

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:

missing action buttons
Hi, I have some Outlook installations here that seem to have no Action Buttons on Calender Events! So you send a calender event, but the User can�t answer with yes, no or whatever possible. Does anyone know where to get back these Buttons? Thanks a lot Lars ...

Entourage 2008
I just upgraded to Entourage 2008 and am missing my "resend" button for emails - is there any way to get a "resend" button to appear in the toolbar with the Forward, Reply, etc. like it used to in Entourage 2004? Mike On 2010-01-13 07:01:58 -0500, Michael Levin said: > I just upgraded to Entourage 2008 and am missing my "resend" button for > emails - is there any way to get a "resend" button to appear in the toolbar > with the Forward, Reply, etc. like it used to in Entourage 2004? There is unfortunately no button, and by defaul...

Excel 2007 Does Not Save
I am using Excel 2007 in Windows Vista Home Premium. When I save, this window pops up: MS Excel is trying to recover your information. This may take several minutes. I have tried at least 6 times to save with the same results. Each time when Excel re-opens I have to enter the same information and try saving again. Each time with the same results. Why is this happening and how can I correct it? Thanks. Look at your anti-virus program. I have heard reports that CA\Etrust antiviral program causes save problems -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove...

How to save .jpg in Outlook 2003
How do I save .jpg pictures in outlook 2003 I could in OE but not Outlook 03. Also when inserting pictures it distorts them and I would like them to be just the size they are. If I use Outlook Express both work fine. Sorry its .gif that I can't save I can see them but can't save them as .gif outlook 03 will only let me save as .bmp. Outlook exp will let me save them as .gif. "Tink" wrote: > How do I save .jpg pictures in outlook 2003 I could in OE > but not Outlook 03. Also when inserting pictures it > distorts them and I would like them to be just the size ...

Simple File Saving question...
Everytime I open an Excel spreadsheet it opens to the last cell that I edited. Does anyone know how to make an Excel spreadsheet open to the top left cell on the first worksheet everytime... regardless of where I saved it last? Thanks, Ian Hi Ian, Try this Private Sub Workbook_Open() Worksheets("Sheet1").Activate Range("A1").Select End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the...

Save .pub to .pdf format
I'm having a little struggle trying to save to .pdf. Went to the MSFT site and carefully followed the instructions. I've saved to .pdf before but sometimes it seems impossible. Using Publisher 2007 and have installed the .pdf converter from MSFT to use with Word, etc. TIA. Jethro Pull wrote: > I'm having a little struggle trying to save to .pdf. Went to the MSFT > site and carefully followed the instructions. I've saved to .pdf > before but sometimes it seems impossible. > > Using Publisher 2007 and have installed the .pdf converter from MSFT > to use...

no send button
My "Send" button has disappeared! I'm using Publisher>send this page as message. When the screen pops up with the To: Cc: Bcc: - and I add the Address, Subject etc. there is no "Send" button or option - either on the screen or under send message as an email in the File Menu - it disappeared! Have MS Outlook properly installed as my primary email. ...

CAN NOT "SAVE AS"
when i go to "save as" it just shows an hour glass and freezes does any one know whats wrong???i can not do any work because i need to save as and send to clients help I read a post, I believe yesterday, that said they cured the problem with xl 2003 by removing the new Windows security updates. Information only, not a recommendation. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "gerrior" <gerrior@discussions.microsoft.com> wrote in message when i go to "save as" it just shows an hour glass and freezes does any o...

why can't i browse to a location to save a flat file
Why doesn't the browse box pop up when i click on the export record button? Instead I have to type the filename and path. ...

saving excel files #2
Hi all , I am having a strange prob in excel whenever i save an excel file, it asks for extension (*.xls) there is something wrong with the settings this i know like when u save a new book on desktop it will save it as vikram.xl instead of vikram what is the way out i dont want this file extension along with the nam -- Vnagpa ----------------------------------------------------------------------- Vnagpal's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1510 View this thread: http://www.excelforum.com/showthread.php?threadid=26734 You can either hide the ext...

close button does not close
Acutally the close button, the big X on the upper right side, does close Excel, I just need to click it twice. While this really isn't a problem, It is annoying. Is there anything I can do to fix this. Thanks It turned out that Groupwise was conflicting with it. I followed the directions in this article and it fixed the problem. http://support.microsoft.com/default.aspx?scid=kb;en-us;260199 "goplayoutside" wrote: > Acutally the close button, the big X on the upper right side, does close > Excel, I just need to click it twice. While this really isn't a ...

Word 2007: how to save to original folder?
How do I force Word 2007 to default to saving files to the folder containing the file I opened? Clearing the "default folder" in the options doesn't do it (at least not with "Save As" when the target is a thumb drive). We generally strongly recommend against saving to (or opening from) any type of removable drive or media. Much safer to save/copy to the HD and then copy/open from there. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "MacAndrewSC" <MacAndrewSC@discussions.microsoft...

"Save as" in IE programatically
When you view an image in IE you can right click and choose save as to save the file to the local machine. I would like to "move" or copy that image into a predefined directory. The thought is why download it again if it's already on my computer. I would like to avoid the unnecessary "save as" step. Any ideas how I could achieve this with active-x? TIA, Bill Try URLDownloadToFile/URLDownloadToCacheFile. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Bill Levis" <bill@voicenet.com> wrote in message news:O##vXt1ZDHA.1492@TK2MSFTNGP12.phx.gbl... &g...

undo sorts button
I have a form with a subform that is displayed in datasheet view. When I right click to sort on a column I get A-Z and Z-A options but there is no clear all sorts option so I would like to add a button to clear all sorts. The button is in the detail section beside the subform. The subform name is called [subEditParts]. Can someone help with this, Thanks Wally On Tue, 11 May 2010 07:00:01 -0700, wallymeister <wallymeister@discussions.microsoft.com> wrote: Me.subEditParts.Form.OrderBy = "" Me.subEditParts.Form.OrderByOn = False -Tom. Microsoft Ac...

We can drag and drop between 2 buttons
Hi all we can drag and drop between 2 butons. My requirement is when user drag from a button, we will restore some info in some place, then user drop to another button. And we can get that restored info to process. It can ? Please help me. Thanks very much. Whats the problem if you are able to drag and drop? All you need to do is handle OnDrop, as you appear to be doing and do the specific work there. Perhaps I am missing something. --- Ajay "James Duy Trinh" <vietdoor@gmail.com> wrote in message news:ehzA7QgPIHA.3916@TK2MSFTNGP02.phx.gbl... > Hi all > > ...

OWA 2003 Logoff Button Results in Login Prompt
We are are running Exchange 2003 SP1, and have a separate front-end server. When we click the 'Logoff' button in the upper right-hand corner of the OWA screen, we are immediately prompted to authenticate again. Can anyone tell me what might be causing this issue? On the OWA front-end, we have Basic authentication enabled (so users dont have to enter a domain\ at logon), and forms authentication is not enabled. We do not have SSL enabled as of yet (we in the pilot phase right now), but will for security reasons later this week. Thanks, Pet On Mon, 25 Jul 2005 08:29:52 -0700,...

Saving Publisher Files to BMP or JPEG
Hi, I have created a publication in MS Publisher but wish to save the format so I may us it in the body of a Outlook email. How do I save to a BMP or JPEG format so I may do this? I don't wish to use it as an attachment. Can someone help? Frank In Publisher 2002-03, file, save as, files of type, scroll down to the image extensions. Older versions, select all, copy, paste to MS Paint or some other editing program. -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Francis Cunningham, Jr." <FrancisCunninghamJr@discussi...

Limiting a Button to a single workbook
I have created a macro in a workbook and assigned it to a custom button that appears on my Macros toolbar. This works great for what I want to do but I only need the macro/button to show up in this one workbook. Now, whenever I create a new workbook, the custom button shows. Is there any way I can limit it to just the workbook I specify? Thanks! When you save your macro there is a box to tell it to save in your personal workbook or save it in this workbook only. Select this workbook only and then delete it out of your personal workbook >-----Original Message----- >I have cr...

Save single pages????
Put together a 4 page doc in Publisher. Is there a way to save individual pages as seperate files? Need to send, e-mail, and files to large for server (38meg). Would like to break down(save) each page and send then be able to put back together. thanks, L. Hi L/P (info@wabashrealty.com), in the Microsoft� newsgroups you posted: || Put together a 4 page doc in Publisher. || Is there a way to save individual pages as seperate files? || Need to send, e-mail, and files to large for server (38meg). Would || like to break down(save) each page and send then be able to put back || together. || || ...

Saving New Documents on a network Drive.
Hiya. Whenever i make a new excel document and have to save it on our office network drive it says, "Cannot save Blank. This folder is read only." Only, the folderis NOT read only. All other software has no issues saving here but excel. any ideas? I'm sick of saving on the local drive and copying it over to the network drive. Thanks. Umm. . . any ideas? "MaxZ" <bmw@florida-counsel.com> wrote in message news:%23WKiYeI5FHA.2816@tk2msftngp13.phx.gbl... > Hiya. Whenever i make a new excel document and have to save it on our > office network drive it...

Saving .xls file as .exe. file
Anyway of saving a .xls file as a executable file. Have VBA code (i.e.PING)that needs to run for several hours and don't want to tie-up EXCEL for other use. Could run VBA code on separate PC, but then someone could start up another sheet and click the 'X' button stopping everything. TIA I don't believe there is any way to compile a VBA Macro. -- Regards; Rob ------------------------------------------------------------------------ "Tom Rudski" <anonymous@discussions.microsoft.com> wrote in message news:1172401c3f5c9$0693d890$a101280a@phx.gbl... > Anyway...

How do you turn the Paste Options Button off on Mac Operating systems.?
Version: 2008 I have worked with PCs for a long time and know how to turn the Paste Options Button off, but do not know how to do it on my Mac computer. <br> Thanks for your help! Hello, On 2009.12.16 9:11, in article 59baf1f3.-1@webcrossing.JaKIaxP2ac0, "clannom@officeformac.com" <clannom@officeformac.com> wrote: > I have worked with PCs for a long time and know how to turn the Paste Options > Button off, but do not know how to do it on my Mac computer. Go to the Word - Preferences command (this is the equivalent of the Windows version's "...

Save As "Word 97-2003 Document" format does not save an RTF file i
Thanks for reviewing this question. Word 2007 does not convert a RTF file to the Word 97 (DOC) format when using Save As and selecting the type: Word 97-2003 Document format. To reproduce: Open Word 2007 add some text to the document Select Save As and the file type "Word 97-2003 & 6.0/95 RTF (*.doc)" Note file is saved in the RTF format Select Save As and set the type to "Word 97-2003 Document (*.doc)" Use the same file name. Notice you will be prompted to save the file again. (This is very annoying to our customers) Open the file in notepad and n...

Macro-Save as
I need to know how to 'default' the save file type as an .xls from a .dat within a macro. After a macro has completed changing many .dat files into excel spreadsheets to include subtotals, the file type is defaulted to .dat and when I go to save the file, I have to constantly change the file type from .dat to .xls. "Lois" wrote: > I need to know how to 'default' the save file type as an .xls from a .dat > within a macro. After a macro has completed changing many .dat files into > excel spreadsheets to include subtotals, the file type is defaulted to...

Save causes Excel to stop responding
OK here's the deal. The environment: Small office LAN- Win'03 entry level server. 6 Win98 machines, 2 WinXP Pro machines We use an excel file to track our proposals (customer, equipment, date dollar amout, etc)- pretty basic. The only thing that isn't simpl data entry is the sequential numbers generated in one column. We've used this same format (sequential numbers modified) for the pas 4.5 years without hassle. Now the file is causing Excel on the 9 machines to lock up- "(not responding)". And on the XP machines it' claiming a sharing violation, though I can...