Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another getFolder(sFolder) Error

Status
Not open for further replies.

mevasquez

Programmer
Aug 26, 2003
75
US
I get an error when the folder name has an apostrophe. Here is part of my code.

Code:
Dim sFolder
dim sFolderRoot

sFolderRoot = oSheet.Cells(2, 1).Value [COLOR=green]'Value is "Z:\AMA's" [/color]

Set sFolder = oFso.getfolder(sFolderRoot & "\")

I get a "Path not found error." I have tried,
Code:
Set sFolder = oFso.getfolder(chr(34) & sFolderRoot & "\" & chr(34))
which does not work

Any suggestions?

TIA

Mike
 
Set sFolder = oFso.getfolder(sFolderRoot & "\")
Works for me, even without the trailing \
Obviously I've created a directory named AMA's in the Z: drive.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top