Check for Network Drive Availability

Posted on 2011-04-26
Last Modified: 2012-06-22
I have a spreadsheet that uses a form to guide users in entering information in a workbook.  After the user performs a task the spreadsheet will save.  The file saves on a server that sometimes goes down and the drive is no longer available to the spreadsheet on saving.  I will then have it redirect the filesave to the users own hard drive.  I would like to know the code necessary to check to see whether the drive is available before the save routine begins.
Question by:DavidH7470
    LVL 85

    Accepted Solution

    On a simplistic level, you could simply use On Error Resume Next, save to the network, then check if err.number <> 0 and in that case save locally.
    LVL 30

    Expert Comment

    Here is a cool link which I always use.

    Topic: Enumerating Local and Network Drives


    LVL 9

    Expert Comment

    besides rorya, u may like this way out too

    store savelocation = network drive path

    check if savelocation is empty, then savelocation = local drive path

    check if savelocation not empty, then save at savelocation

    Author Closing Comment

    Sometimes simple is best

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now