Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Aug 2013
    Posts
    46
    Thanks
    11
    Thanked 0 Times in 0 Posts

    What is the proper way to handle directories for work files and final files?

    My VBA code gets user inputs and creates final word file and final pdf file. It is now ready and working, but I am not sure what is the right way to deploy it.
    The code will be used by several users at a certain office, but on personal computers (i.e. no common network drive).

    My idea is to have a folder "XX" under "my documents", and two sub-folders: "XXwork", "XXresults".

    I can't refer to the absolute path because it is different per user, and perhaps per OS version (8? 7? XP?).
    is there a proper way/recommended way, or even maybe a pre-made "install procedure"?

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    You could create an installer to ensure the folders are created before your macros run. Alternatively, your macros could check for the presence of these folders and create them if not found. I would choose the latter since you don't want your code to curl up its toes if the user renames your folders after an install.

    The 'My Documents' folder is easily identifiable in vba. eg http://dailydoseofexcel.com/archives...uments-in-vba/
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    YigalB (2014-11-05)

  4. #3
    Lounger
    Join Date
    Aug 2013
    Posts
    46
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Andrew Lockton View Post
    You could create an installer to ensure the folders are created before your macros run. Alternatively, your macros could check for the presence of these folders and create them if not found. I would choose the latter since you don't want your code to curl up its toes if the user renames your folders after an install.

    The 'My Documents' folder is easily identifiable in vba. eg http://dailydoseofexcel.com/archives...uments-in-vba/
    Thanks - I implemented it within the macro, and it is working well.
    I still need to test it on several scenarios, like different OSs, but I think this is good enough.

Tags for this Thread

Posting Permissions

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