default file location

G

Guest

I have a user with Excel 2000. She changes her default file location using
Tools, Options, etc. to her L drive by typing L:\. That works fine for
awhile. Eventually though it will revert back to her C drive. When she looks
in the Tools, Options dialog box, it actually says C:\. She is a laptop user
and is wondering if this may be happening when she is using her laptop at
home without access to the L drive. However, the other Office applications
are able to keep the L drive as the network drive permanantly. Anyone have
any insight on this?
 
D

Dave Peterson

Maybe she's opening excel when she's not connected to the network???

Then there won't be an L: drive.

I put a workbook in my XLStart folder that tried to reset that option to my
network folder each time excel opened. Then it would close just to get out of
the way.

This was the macro:

Option Explicit
Sub auto_open()

'Dim FSO As Scripting.FileSystemObject
Dim FSO As Object

Const myDefaultFolder As String = "U:\my u documents\excel"

'Set FSO = New Scripting.FileSystemObject
Set FSO = CreateObject("scripting.filesystemobject")

With Application
If FSO.FolderExists(folderspec:=myDefaultFolder) Then
.DefaultFilePath = myDefaultFolder
ChDrive myDefaultFolder
ChDir myDefaultFolder
Else
MsgBox "DefaultFilePath not reset, still: " & .DefaultFilePath
End If
End With
ThisWorkbook.Close savechanges:=False

End Sub

(Don't forget to change my drive/folder to the one she needs.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

(I don't recall if other applications behaved differently. But I know xl2k
(work version) behaves this way.)
 
G

Guest

Thanks Dave. She was opening Excel when not connected to the network. We'll
give that code a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top