Thread: GetFolder error
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default GetFolder error

Use the below before you set the folder object

fso.DriveExists()
fso.FolderExists()

If this post helps click Yes
---------------
Jacob Skaria


"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