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

Report
Posts
367
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
-
Posts
367
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
-
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

2 replies

Posts
367
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
122
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.
1
Thank you

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

CCM 2942 users have said thank you to us this month

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
763
what if you put a ".xls" yourself with the file name ?
Posts
367
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
122
its works

Thanks!
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
763
so what is the difference between the files that gets saved properly and those that do not

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!