Thread: GetFolder error
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default GetFolder error

Look at the filedialog method. You can specify the default drive and default
filename.

"Barb Reinhardt" wrote:

I guess I need to clarify my question. The K drive does exist, but it only
sees it once I manually access it by typing "K:" in a browser. I want to
avoid having to do this. How do I do that?

"Joel" wrote:

Set FSO = CreateObject("Scripting.fileSystemObject")
If FSO.FolderExists(folderspec) then
Set RootFolder = FSO.getFolder(myFolder)
else
msgbox("Folder : " & myfolder & " Doesn't Exist")

end if


"Barb Reinhardt" wrote:

I have the following piece of code

Set FSO = CreateObject("Scripting.fileSystemObject")

Set RootFolder = FSO.getFolder(myFolder)


myFolder = "K:" (with other folders)

I get an error if I haven't accessed the mapped K drive. Does anyone have
any suggestions as to how to avoid this error?

Thanks,
Barb Reinhardt