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

RWomanizer 368 Posts Monday February 7, 2011Registration dateContributorStatus September 30, 2013 Last seen - Feb 15, 2011 at 05:20 AM - Latest reply: RWomanizer 368 Posts Monday February 7, 2011Registration dateContributorStatus September 30, 2013 Last seen
- 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 

4 replies

Best answer
RWomanizer 368 Posts Monday February 7, 2011Registration dateContributorStatus September 30, 2013 Last seen - Feb 18, 2011 at 03:05 AM
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.

Thank you, RWomanizer 1

Something to say? Add comment

CCM has helped 1902 users this month

rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Feb 18, 2011 at 11:18 AM
what if you put a ".xls" yourself with the file name ?
RWomanizer 368 Posts Monday February 7, 2011Registration dateContributorStatus September 30, 2013 Last seen - Feb 21, 2011 at 12:23 AM
its works

Thanks!
rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Feb 17, 2011 at 08:27 AM
0
Thank you
so what is the difference between the files that gets saved properly and those that do not