+ Reply to Thread
Results 1 to 7 of 7

VBA to check and see if network drive is mapped

Hybrid View

hutch@edge.net VBA to check and see if... 08-28-2013, 11:41 PM
hutch@edge.net Re: VBA to check and see if... 08-29-2013, 07:20 AM
hutch@edge.net Re: VBA to check and see if... 08-29-2013, 08:05 PM
romperstomper Re: VBA to check and see if... 08-29-2013, 08:20 PM
hutch@edge.net Re: VBA to check and see if... 08-29-2013, 08:28 PM
romperstomper Re: VBA to check and see if... 08-29-2013, 08:40 PM
hutch@edge.net Re: VBA to check and see if... 08-29-2013, 10:02 PM
  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    VBA to check and see if network drive is mapped

    Hello again, Gurus.

    I have a macro used by several people on different computers that saves a file to our network. From time to time, for reasons unknown, some users may lose connection to the mapped network drive. I need to begin the Macro with a check to see if the drive is available to the user, and if it isn't available give a message, "The PO Tracking Drive is not available. Please contact your System Administrator.", and then end the macro.

    The network drive is \\fs950o\PO Tracking, and the drive letter is "M".

    Thanks in advance for any help you can offer.

    Hutch
    Last edited by hutch@edge.net; 08-29-2013 at 10:03 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: VBA to check and see if network drive is mapped

    Bump, Please.

    Have a great day!

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: VBA to check and see if network drive is mapped

    No luck with this one? I would have thought there was a way to check to confirm if a network drive is mapped via VBA.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: VBA to check and see if network drive is mapped

    Have you tried simply using Dir?
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: VBA to check and see if network drive is mapped

    Thanks for the reply, Rory.

    No, sir. I haven't tried using Dir. Sorry to say I don't know how. I have already searched the forum for "how to detect if a network drive is mapped", and found nothing that seemed to fit my needs. Do you think I would have better luck if I searched, "Using Dir to detect a network drive"?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: VBA to check and see if network drive is mapped

    You could probably also use ChDrive with an error trap:
    on error resume next
    chdrive "M"
    If err.number <>0 then
       Msgbox "M drive not mapped"
       Exit sub
    End if
    On error goto 0

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: VBA to check and see if network drive is mapped

    That appears to work perfectly, Rory. Thank you so much. This thread will be marked as CLOSED.

+ 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. Drive Letter Property not returning mapped drive letter
    By Mike_bee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2013, 02:45 PM
  2. Save files to a Mapped Network Drive on server
    By wotsup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2012, 11:46 AM
  3. Replies: 0
    Last Post: 10-07-2010, 10:37 AM
  4. ODBC from not mapped Drive
    By iancallaghan87 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-14-2007, 10:53 AM
  5. [SOLVED] Excel 2003 - problem saving to a mapped network drive
    By Chris in forum Excel General
    Replies: 1
    Last Post: 10-17-2005, 01:05 PM

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