View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alex St-Pierre Alex St-Pierre is offline
external usenet poster
 
Posts: 169
Default Doesn't work all the time

Thank Dave..
What I did wrong is the following:

Dim FSO As Object
Set FSO = CreateObject("scripting.filesystemobject")
if FSO.DriveExists(drivespec:="v") = true then ...
MsgBox BoolExist
endif
So, I though FSO.Drive was true because the condition is satisfied.
By declaring a Boolean, I see that the result is false !!
--
Alex St-Pierre


"Dave Peterson" wrote:

If you're looking for a drive, don't you want driveexists?

Dim BoolExist As Boolean
Dim FSO As Object
Set FSO = CreateObject("scripting.filesystemobject")
BoolExist = FSO.DriveExists(drivespec:="v")
MsgBox BoolExist



Alex St-Pierre wrote:

Hi,
I have tried this and boolExist takes the value of true (doesn't work all
the time)
I have also try the cbool and doesn't work on excel 2002. I tried Cbool with
excel 2003 and it work's well.. It's very strange..

dim fso
set fso = createobject("scripting.flesystemobject")
boolExist = fso.fileexists("V:") (takes value true ??)
set fso = nothing
--
Alex St-Pierre


--

Dave Peterson