Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default file extension

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default file extension

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


"Young-Hwan Choi" wrote in message
...
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.




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
Display file name without the file type extension NAHolmes Excel Worksheet Functions 5 November 23rd 09 05:54 PM
Determine Excel file version with no file extension. tjlumpkin Excel Discussion (Misc queries) 2 July 23rd 09 06:59 AM
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
I need to download an exel spreadsheet file. (file extension :xls) buckrogers Excel Discussion (Misc queries) 2 December 8th 04 11:08 PM


All times are GMT +1. The time now is 09:33 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"