+ Reply to Thread
Results 1 to 3 of 3

Creating a folder if it doesn't exist and saving an active workbook in that folder

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    Canada
    MS-Off Ver
    ms365
    Posts
    79

    Creating a folder if it doesn't exist and saving an active workbook in that folder

    Hi everyone,
    I want to create a folder if it doesn't exist, i got that part down.
    HTML Code: 
    now I have an excel file that im making changes to and I want to save it as a new file (with a different name) in the folder I have created above. something like this:
    HTML Code: 
    how do I make a variable out of the folder I created and place it in the strLocation? so then I would just need to use the SaveAs function to save that entire path strLocation. anyhelp would be much appreciated. thank you.
    best Regards,
    Ahsan K

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Creating a folder if it doesn't exist and saving an active workbook in that folder

    Hello

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Creating a folder if it doesn't exist and saving an active workbook in that folder

    Hello Mr. Leith
    I think there's something wrong in these lines
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    If myFolder string is assigned to active workbook path then in the last line there will be a problem as it is assigned again in the active workbook path .. In this case I think this will be incorrect
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create folder in list if it doesn't exist
    By ChrysanthiM in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-22-2016, 12:04 PM
  2. Create a Folder if it doesn't not exist.
    By Lucholac44 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2016, 08:38 AM
  3. [SOLVED] VBA to save a workbook to a folder but create that folder if it doesn't already exist
    By cnixon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-24-2014, 06:01 PM
  4. Code to create New Folder (if doesn't exist) and then Save Workbook to folder
    By jenhawley in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-10-2013, 03:09 PM
  5. Save a file to a folder, create folder if it doesn't exist
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2010, 09:12 AM
  6. Replies: 6
    Last Post: 08-11-2006, 03:41 PM
  7. [SOLVED] Create Folder If It Doesn't Exist
    By Neutron1871 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2005, 09:06 PM

Tags for this Thread

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