file extension

Y

Young-Hwan Choi

I just upgraded from Office 2000 to Office 2003.
This is the code that I made from 2k version.

Sub Make_File()
Workbooks(my_book).Sheets("form").Copy
Set New_File = Workbooks(Workbooks.Count)
New_File.SaveAs Filename:=my_Dir & Sheets(1).Range("A1")
New_File.Close
End Sub

"my_dir" is a string and defined as "D:\test"
A1 is also string and includes a period, say A12.34

While it works fine in V. 2K, V. 2003 is not working fine..
The files that are generated from V. 2003 don't have file extension. And I
realized that the reason was because there was a period in the cell A1. (if
there is no period, it gives me an xls extension). The file name is "A12.34"
instead of "A12.34.xls".

Is there any structural cure for this instead of manually adding & ".xls" ?

thanks.
 
N

Nigel

Same thing exists in XL2002 and AFAIK you need to add the extension. XL
will parse the string and read the DP as the name.ext separator. I have not
found another way around it.

Cheers
Nigel
 
Top