Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Macro saved .xls file is not opening in 2007

Hi All,

I've asked the below quesion in another post but I didn't get solution. Let
me try one more time.

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Macro saved .xls file is not opening in 2007

You getting new file format with old file extension. Do this instead:

wbkTemplate.SaveAs "C:\Output", xlWorkbookNormal

Excel put on right file extension if you tell it right format.

"Vinod" wrote in message
...
| Hi All,
|
| I've asked the below quesion in another post but I didn't get solution.
Let
| me try one more time.
|
| 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
|

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Macro saved .xls file is not opening in 2007

Thanks for your response.

Do you mean that it should be
wbkTemplate.SaveAs "C:\Output.xls", xlWorkbookNormal
for saving in excel 2003 version?


"Homey" wrote:

You getting new file format with old file extension. Do this instead:

wbkTemplate.SaveAs "C:\Output", xlWorkbookNormal

Excel put on right file extension if you tell it right format.

"Vinod" wrote in message
...
| Hi All,
|
| I've asked the below quesion in another post but I didn't get solution.
Let
| me try one more time.
|
| 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
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when opening a 2007 template saved in 2003 format from a mac Mover10 Excel Discussion (Misc queries) 2 July 1st 09 09:41 PM
Macro buttons opening saved macro Wasabijim Excel Discussion (Misc queries) 0 April 29th 09 08:39 PM
Edits not saved when re-opening file SmartCookie Excel Worksheet Functions 1 January 2nd 09 07:16 PM
Excel file not opening when saved with Extention .html sfleck Excel Worksheet Functions 1 April 22nd 08 05:14 PM
Shared file not opening to a saved point Steve Excel Discussion (Misc queries) 2 October 4th 07 05:21 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"