+ Reply to Thread
Results 1 to 8 of 8

Save File

  1. #1
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Save File

    I am having trouble saving a file in a different location but using the same file name.
    I open the file from the "C:\Aus_Nav\2011\August" folder and then I change the data automatically through some other code and then after that code is run I want to save it by default back one folder "C:\Aus_Nav\2011\" folder. I want it this way as next year the opening folder would be "C:\Aus_Nav\2012\August" and I would want it to be saved into "C:\Aus_Nav\2011\". Even better would be to save it into the a folder that is the current month the file is being saved (I don't think this 2nd option is possible and that's why I suggest the other option).

    The "Application.Dialogs(xlDialogSaveAs).Show" uses the same file name as I want but it saves it into the same folder it was opened from. I've research for many hours and tried several ways but have succeeded.

    I would appreciate any help anyone can give me.
    Last edited by ddbusiness; 10-05-2010 at 11:48 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Save File

    Please Login or Register  to view this content.



  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Save File

    What code have you got now?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Save File

    Sorry I did not reply last night as I went to bed just before you replied RoyUK being 10pm in Sydney.
    The code snb sent I can't get to work as it saves it in the same folder listed on the first line of the code.
    Myself when I posted this I was only using the dialog save as code.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Save File

    It seems the the code only saves it in the same folder list in the first line (August) of the code and not rather than (2011): one folder down from the original
    Sorry I shut my computer down just as you sent your reply as it was late in Australia.
    Thanks for any suggestions

  6. #6
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Save File

    I've come up with some other code but it doesn't quite work.The dialog box does save a file in one folder up from where the file was opened from so I can choose a different folder under it. But now I loose the original filename in the dialog box. The dialog box does not have a filename listed. Thanks for any help you can give me.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Save File

    Please Login or Register  to view this content.
    I fear your eyes were to tired when you tested.
    Prerequisite for the code to work is that the filepath has more than 1 subfolder.

  8. #8
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Save File

    With help from a few the following has helped me resolve this.
    Thanks
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1