Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Verify if filename is valid

Hi,
I need to say if a specific path refer to a valid file. It tried to use the
function below but it give true if the directory is valid.
ex:
myFileName = "C:\Temp" should answer false (all the time)
myFileName = "C:\Temp\Test.xls" should answer true (if file exist)

I tried that but doesn't work.
Len(Dir$((myFileName,vbdirectory)
Len(myFileName)
CBool(Len(Dir(myFileName)))

Thanks
--
Alex St-Pierre
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
'filename' not a valid web archive adam_hw Excel Discussion (Misc queries) 0 April 12th 06 07:34 AM
XL2000: "Filename is Not Valid" Steve Excel Discussion (Misc queries) 0 June 22nd 05 10:06 PM
Several Dates -Verify zeek Excel Worksheet Functions 4 January 16th 05 01:31 PM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM


All times are GMT +1. The time now is 05:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"