LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Valid File Path Format

Thanks didnt think about doing that. It works. I looked
in VBA help and could not find a list of all the error
numbers. Do you have a list that lists all the possible
err types?

Todd
-----Original Message-----
Todd,

I don't think there is a (built in) way to check just the

syntax
of a file name. Since, I assume, you are going to use the

value
to open or save a file, just go ahead and do the

operation and
use an error trap to determine the success of the

operation. An
alternative would be to use the Dir() function, and test

for an
error.

Dim FNum As Integer
Dim FName As String
On Error GoTo ErrH:
FName = "invalid/::???file\\\??name"
FNum = FreeFile()
If Dir(FName) = "" Then
' do nothing
End If
Exit Sub
ErrH:
If Err.Number = 52 Then
MsgBox "Invalid filename "
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Todd Huttenstine"

wrote in
message ...
Good morning

How do you check a value to see if it is in a valid file
path format?


Thank you
Todd Huttenstine



.

 
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
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
File format not valid Ginny Excel Discussion (Misc queries) 1 March 6th 06 11:19 PM
File format is not valid FB Excel Discussion (Misc queries) 5 November 22nd 05 03:35 PM
file format not valid ACW Excel Discussion (Misc queries) 3 August 1st 05 10:45 PM
file format not valid jeniflower Excel Discussion (Misc queries) 2 February 6th 05 11:03 PM


All times are GMT +1. The time now is 12:30 PM.

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

About Us

"It's about Microsoft Excel"