Macro not saving file in excel format

Solved/Closed
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Feb 15, 2011 at 05:20 AM
RWomanizer Posts 365 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
Related:

2 responses

RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 120
Feb 18, 2011 at 03:05 AM
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
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 18, 2011 at 11:18 AM
what if you put a ".xls" yourself with the file name ?
0
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 120
Feb 21, 2011 at 12:23 AM
its works

Thanks!
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 17, 2011 at 08:27 AM
so what is the difference between the files that gets saved properly and those that do not
0