If you want to avoid that dialog, use SetErrorMode.
In reply to Re^2: Error with GetDRIVE() when using a mapped drive by Corion in thread Error with GetDRIVE() when using a mapped drive by vanz