ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   .xls file is not opening in excel 2007 (https://www.excelbanter.com/excel-discussion-misc-queries/235873-xls-file-not-opening-excel-2007-a.html)

vinod

.xls file is not opening in excel 2007
 
Hi All,

I'm using a Macro which will open a template with predefined formulas and
copies selected sheet data into template. After coping, template will be
calculated with copied data after this template will save as Output.xls and
closes the saved file. By this macro functionality is completed.

Here is the sample code:
set wbkTemplate=workbook.open("C:\Template.xls",false)
Copying input sheet data into 'RawData' of wbkTemplate.

wbkTemplate.SaveAs "C:\Output.xls"
wbkTemplate.close
set wbkTemplate=Nothing


While opening output.xls I'm getting following error:
The file you are trying to open, 'Output.xls', is in a different format than
specified by the files extension. Verify that the file is not corrupted and
is from trusted source before opening the file. Do you want to open the file
now?

On clicking 'Yes' Output.xls is opening machine language.

We observed this above error while running macro at excel 2007. Origionally
the macro is developed and tested at excel 2003 without issue.

Please helpme out on resolving above said issue by sharing your thoughts and
ideas which will be appreciated.

Advanced Thanks
Vins


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com