Macro not saving file in excel format [Solved/Closed]

Posts
368
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
- - Latest reply: RWomanizer
Posts
368
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
- Feb 21, 2011 at 12:23 AM
Hello,


I have a coding like this:
filename = Range("B3").Value
Workbooks.Add
    Set newwb = ActiveWorkbook
    ChDir "D:\P3\Jan-11\B2B"
    ActiveWorkbook.SaveAs filename, FileFormat _
        :=xlExcel8, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
        False, CreateBackup:=False


I am using excel2007 but I have to save file in excel2003.

by this command the file is saved with said name but the file type is not excel, the type just come as "file". on the contrary some files are saving in excel format when I excute the code again and again.

kindly help me whats wrong in the code.

Thanks!
Rahul
See more 

2 replies

Best answer
Posts
368
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
1
Thank you
there is no difference is file all are excel 2007 files. if I loop the above code at after every 3 iteration the program save .xls file but other as just file type.

Say "Thank you" 1

A few words of thanks would be greatly appreciated. Add comment

CCM 6303 users have said thank you to us this month

rizvisa1
Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
752 -
what if you put a ".xls" yourself with the file name ?
RWomanizer
Posts
368
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120 -
its works

Thanks!
Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
752
0
Thank you
so what is the difference between the files that gets saved properly and those that do not