LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default CurDir, ChDrive, ChDir error questions

In excel 2003 windows xp I have been using the following code for a
long time successfully:

sub ForceDirectoryOpenSave

Dim strStartingDirectory As String
strStartingDirectory = CurDir
ChDrive "T"
ChDir "T:\xx\xy\xu\xa"

' code for whatever application.get___ i need

ChDrive strStartingDirectory
ChDir strStartingDirectory

end sub

Recently I have started having errors on the line;

ChDrive strStartingDirectory

It seems to happen randomly ie not every time the users have that
code, or even every time the machine is restarted ect and if you rerun
the sub (or skip JUST that line in subs without full error handling)
it works. After reading through groups I assume that the system admins
(i work at a large public university) have started controlling some
things with UNC paths and when excel last used a UNC path it errors.
All of our data/workspace is on the T drive so I dont have to be able
to "point" to UNC paths for the dialogs. I just am tired of subs being
dropped out of randomly and having to figure out how to get the user
back to where they need to be to continue working without negative
effects.
What are the "consequences" (if any) of not changeing the Drive back
to match the starting directory but changing the directory back? Or
using OnError Resume Next to "shut off" my regular error handling for
these instances to stop this from dropping users out of subs (then
after that line using OnError Goto ErrorHandler to "turn on" normal
error handling again) so that when excel is pointing to a mapped drive
it still changes it back?

thanks
john
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ChDir and ChDrive Conan Kelly Excel Programming 2 December 24th 08 09:26 PM
Workaround for ChDir/CurDir when path has unicode characters keepITcool Excel Programming 4 July 10th 07 04:56 PM
ChDrive error (server path) Marcotte A Excel Programming 6 November 2nd 05 07:16 PM
Problems with ChDrive and ChDir Sophie Excel Programming 5 December 2nd 04 04:33 PM
Problems with ChDrive, ChDir Sophie Excel Programming 4 November 29th 04 09:35 AM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"