Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 72871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:06:45+00:00 2026-05-10T20:06:45+00:00

I am updating a VBA program (excel). At startup the program checks if it

  • 0

I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office file server using:

FileSystemObject.FolderExists('\\servername\path') 

If this is not found the program switches to offline mode and saves its output to the local hard disk (for later transfer), instead of directly to the fileserver.

This works OK, It’s very quick if the computer can reach the path, however it can sometimes take a while (up to one minute) for the call to FolderExists to complete/time-out, especially if there is a network connection open but the required path does not exist (i.e. we are connected to some other LAN).

My Question(s):

  1. is there a quicker/better way to check for the existence of a network path using VBA?

  2. is there a way to have the user cancel the search done by FolderExists() when (s)he knows it cannot succeed because they’re not in the office. I.e. is there some way to prematurely exit FolderExists() (or any other function call for that matter)

I want the solution to have as little user input as possible, which is why the check is done automatically, rather than just asking the user if (s)he’s in the office or not in the first place.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:06:46+00:00Added an answer on May 10, 2026 at 8:06 pm

    If you’re on a domain:

    Check the LOGONSERVER environmental variable.

    If there are two ‘\’ symbols before the server name, it’s connected to active directory and so you should do your check.

    Otherwise, it isn’t logged into the office network, so you can bypass the check.

    If you aren’t on a domain:

    Probably your best bet is to run a ping against the target server.

    If it can’t get a ping response, it either isn’t connected to the network, isn’t connected to YOUR network, or the server is down. You don’t want your code to run either way, in those cases.

    MVPS.ORG and MSDN Forums both have some code samples for that,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 168k
  • Answers 168k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is a bug in iPhone SDK 3.0. It is… May 12, 2026 at 1:46 pm
  • Editorial Team
    Editorial Team added an answer Copy C:\Program Files\Microsoft Visual Studio 9.0\VC\Include\io.h under the name unistd.h… May 12, 2026 at 1:46 pm
  • Editorial Team
    Editorial Team added an answer You may get some performance difference from just using top,… May 12, 2026 at 1:46 pm

Related Questions

I am updating a web application and have decided to use SubSonic as it
I am updating a website for a radio station and they would like to
I don't know very much about c#. I am updating a page built by
I've made a small example with a Person class, which contains a list of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.