View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Naming convention for workbook names

If you avoid punctuation character other than a space or comma, you should
be OK. There are no special rules that apply to workbooks. A workbook name
must be a valid Windows file name, no more, no less. You could test with
code for a valid name before using it.

Function IsValidFileName(FileName As String) As Boolean
Dim S As String
On Error Resume Next
S = Dir(FileName)
IsValidFileName = (Err.Number = 0)
End Function

Sub AAA()
Dim FName As String
FName = "Bo|ok1.xls"
If IsValidFileName(FName) = True Then
Debug.Print "FileName Is Valid"
Else
Debug.Print "FileName is not valid."
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)
"Barb Reinhardt" wrote in message
...
Can someone direct me to the naming convention for workbook names. What
is
allowed and what is not? I want to suggest some workbook names for a
SAVEAS
and want to avoid traps because of the convention.

Thanks,
Barb Reinhardt