default working folder

G

Guest

The default working folder in excel resets itself after setting it up. This
will not happen for a little while but does reset to the default c:\my
documents folder. Any Ideal why this happens?
 
D

Dave Peterson

Do you have your default folder on a network drive?

Is that network drive sometimes unavailable?

===
We use laptops at work. My default folder is on my home drive
(U:\my u documents\excel)

If I turn on my pc at home (not connected to the network), then excel still
needs to have a default folder--it goes back to the C: drive and uses the
standard folder.

I have a workbook in my XLStart folder that contains a macro like this:

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

Maybe you can use the same technique to reset it--no matter what the cause.
 
G

Guest

Thanks for the Info. One of the IS personal I work with also recided the
same thing. I will give this a shot.....
 

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