+ Reply to Thread
Results 1 to 11 of 11

Saving To A Network Drive

  1. #1
    Registered User
    Join Date
    05-13-2007
    Location
    Australia
    MS-Off Ver
    Office365 on Windows10
    Posts
    12

    Saving To A Network Drive

    HI All,

    I am sure this has been posted before. I have tried searching with little luck.

    We have a form that is completed by our employees and emailed to a central group email address that up to 8 employees within our team can access. When one of our 8 team members open the file sent they need to add comments to it and then save it in a central directory on one of our network drives.

    Now the problem I have is that we all have the network drive mapped to a different letter.

    Is there a way that I can have a macro (see below for current macro that does not work) save to a network path and not a drive letter.

    Please Login or Register  to view this content.
    Any help appreciated.

    Thanks

    Andrew
    Last edited by kreiny; 01-06-2009 at 07:56 PM.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Andrew, I am confused. The line in your code:

    Please Login or Register  to view this content.
    is saving to a network path, and not a drive letter, as you are request. Is this not working for you? If you are simply asking if it will work, the answer is yes.

    Jason

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Did you try:
    Please Login or Register  to view this content.
    You may need to append quotes on each end.

  4. #4
    Registered User
    Join Date
    05-13-2007
    Location
    Australia
    MS-Off Ver
    Office365 on Windows10
    Posts
    12
    Quote Originally Posted by jasoncw View Post
    Andrew, I am confused. The line in your code:

    Please Login or Register  to view this content.
    is saving to a network path, and not a drive letter, as you are request. Is this not working for you? If you are simply asking if it will work, the answer is yes.

    Jason
    Hi Jason,

    Thanks for the quick response.

    It is not saving the file to the network drive. It is saving to my C:\Documents and Settings\akn\My Documents\ folder.

    Any suggestions??

    Thanks

    Andrew

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Changing directories doesn't work across drives; you have to change drive first. From Help:

    The ChDir statement changes the default directory but not the default drive. For example, if the default drive is C, the following statement changes the default directory on drive D, but C remains the default drive:

    ChDir "D:\TMP"

    But it shouldn't be necessary. Try just
    Please Login or Register  to view this content.
    Last edited by shg; 01-06-2009 at 06:58 PM.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Just to add a useful link on the subject

    http://www.dailydoseofexcel.com/arch...6/21/unc-path/

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  7. #7
    Registered User
    Join Date
    05-13-2007
    Location
    Australia
    MS-Off Ver
    Office365 on Windows10
    Posts
    12
    Quote Originally Posted by shg View Post
    Changing directories doesn't work across drives; you have to change drive first. From Help:

    The ChDir statement changes the default directory but not the default drive. For example, if the default drive is C, the following statement changes the default directory on drive D, but C remains the default drive:

    ChDir "D:\TMP"

    But it shouldn't be necessary. Try just
    Please Login or Register  to view this content.
    Thanks,

    While this saved to the correct directory it did not save with the correct file name being referrenced from cells within the spreadsheet.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    So debug the code as the string is being built.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Also, if you haven't already, put Option Explicit at the top of the code module.

  10. #10
    Registered User
    Join Date
    05-13-2007
    Location
    Australia
    MS-Off Ver
    Office365 on Windows10
    Posts
    12

    Thumbs up

    Hi All,

    Thanks for all the help.

    This now works using the following code.

    Please Login or Register  to view this content.
    Once again thank you all.

    Andrew

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Would you please mark the thread as solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ 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