Hi again,
I think I would prefer my method, but of course it depends on what shall
happen later in the code.
If the folder should be created when fe=false, or if you need to check if
file exists when fe= true using fs.FileExiste(MyFolder & MyFileName) I would
use this method for sure.
Hopes it helps
Regards,
Per
"broro183" <(E-Mail Removed)> skrev i meddelelsen
news:8792F98D-276D-407F-B285-(E-Mail Removed)...
> hi Per,
>
> A third option eh?
>
> I haven't seen this option before but I am wary of using FSO approaches
> after reading the below link:
> http://www.tech-archive.net/Archive/.../msg01857.html
> as I've recently mentioned in post # 2 of
> http://www.excelforum.com/excel-prog...pen-files.html
>
> When you line the FSO approach up against my suggestions, is one technique
> "better" than the others?
>
> Thanks
> Rob
>
> __________________
> Rob Brockett
> NZ
> Always learning & the best way to learn is to experience...
>
>
> "Per Jessen" wrote:
>
>> Hi Rob
>>
>> Why not use the FolderExists method?
>>
>> Set fs = CreateObject("Scripting.FileSystemObject")
>> fe = fs.FolderExists(strfullpath)
>>
>> Regards,
>> Per
>>
>> "broro183" <(E-Mail Removed)> skrev i meddelelsen
>> news:B6465D5E-EB11-4B2A-B786-(E-Mail Removed)...
>> > hi all,
>> >
>> > I have come across the below techniques for identifying if a
>> > file/folder
>> > exists, both seem to work but is one technique "better" than the other?
>> >
>> > if not dir(strfullpath,vbdirectory) = vbnullstring then
>> > doesfilefolderexist
>> > = true
>> > 'or
>> > if len(dir(sbasefolder, vbdirectory)) > 0 then doesfilefolderexist =
>> > true
>> >
>> > TIA
>> > Rob
>> > __________________
>> > Rob Brockett
>> > NZ
>> > Always learning & the best way to learn is to experience...
>> >
>>
>>