Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Excel 2007 - Workbook.Open Question

I have the following line that works in PowerPoint 2003, but doesn't in
PowerPoint 2007. I'm asking here because I think it's more of an Excel
question.

Set XLBook = XLApp.Workbooks.Open(sFile, UpdateLinks:=False)

I have everything dimensioned as needed. The error I'm getting is as
follows:

Run-time error '1004':

Excel cannot open the file 'FILENAME.xlsm'
because the file format or file extension is not valid. Verify that the file
has not been corrupted and that the file extension matches the format
of the file.

Thanks,

Barb Reinhardt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Excel 2007 - Workbook.Open Question

FWIW, I don't have a problem opening a .xls file when testing the code on
Office 2007.
Thanks,
Barb Reinhardt


"Barb Reinhardt" wrote:

I have the following line that works in PowerPoint 2003, but doesn't in
PowerPoint 2007. I'm asking here because I think it's more of an Excel
question.

Set XLBook = XLApp.Workbooks.Open(sFile, UpdateLinks:=False)

I have everything dimensioned as needed. The error I'm getting is as
follows:

Run-time error '1004':

Excel cannot open the file 'FILENAME.xlsm'
because the file format or file extension is not valid. Verify that the file
has not been corrupted and that the file extension matches the format
of the file.

Thanks,

Barb Reinhardt


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Excel 2007 - Workbook.Open Question

I'm begining to think that the file I was opening was corrupted. I can open
and close other file.xlsm files.

Barb Reinhardt

"Barb Reinhardt" wrote:

I have the following line that works in PowerPoint 2003, but doesn't in
PowerPoint 2007. I'm asking here because I think it's more of an Excel
question.

Set XLBook = XLApp.Workbooks.Open(sFile, UpdateLinks:=False)

I have everything dimensioned as needed. The error I'm getting is as
follows:

Run-time error '1004':

Excel cannot open the file 'FILENAME.xlsm'
because the file format or file extension is not valid. Verify that the file
has not been corrupted and that the file extension matches the format
of the file.

Thanks,

Barb Reinhardt


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 2007 - Workbook.Open Question

You will get that error message if a file is not a true XLSM, for instance
if an XLS is renamed. Of course it could be something else.

--
Jim
"Barb Reinhardt" wrote in message
...
| I'm begining to think that the file I was opening was corrupted. I can
open
| and close other file.xlsm files.
|
| Barb Reinhardt
|
| "Barb Reinhardt" wrote:
|
| I have the following line that works in PowerPoint 2003, but doesn't in
| PowerPoint 2007. I'm asking here because I think it's more of an Excel
| question.
|
| Set XLBook = XLApp.Workbooks.Open(sFile, UpdateLinks:=False)
|
| I have everything dimensioned as needed. The error I'm getting is as
| follows:
|
| Run-time error '1004':
|
| Excel cannot open the file 'FILENAME.xlsm'
| because the file format or file extension is not valid. Verify that the
file
| has not been corrupted and that the file extension matches the format
| of the file.
|
| Thanks,
|
| Barb Reinhardt
|
|

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Excel 2007 - Workbook.Open Question

I've discovered part of my problem. If I save a workbook as a .xlsm with
Workbook_SaveAs code (I think that's it) AND there are named ranges that
Excel 2007 does not like, I get no error and am unable to open the workbook
again. Ain't life grand?

Barb Reinhardt

"Jim Rech" wrote:

You will get that error message if a file is not a true XLSM, for instance
if an XLS is renamed. Of course it could be something else.

--
Jim
"Barb Reinhardt" wrote in message
...
| I'm begining to think that the file I was opening was corrupted. I can
open
| and close other file.xlsm files.
|
| Barb Reinhardt
|
| "Barb Reinhardt" wrote:
|
| I have the following line that works in PowerPoint 2003, but doesn't in
| PowerPoint 2007. I'm asking here because I think it's more of an Excel
| question.
|
| Set XLBook = XLApp.Workbooks.Open(sFile, UpdateLinks:=False)
|
| I have everything dimensioned as needed. The error I'm getting is as
| follows:
|
| Run-time error '1004':
|
| Excel cannot open the file 'FILENAME.xlsm'
| because the file format or file extension is not valid. Verify that the
file
| has not been corrupted and that the file extension matches the format
| of the file.
|
| Thanks,
|
| Barb Reinhardt
|
|




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
How to remove password protect to open Excel 2007 workbook JoWrobs Excel Discussion (Misc queries) 3 February 4th 10 11:18 PM
Workbook does not open by default in Excel 2007 Jacob Excel Discussion (Misc queries) 2 August 4th 09 09:11 PM
How do I open a workbook automatically in Excel 2007/Vista Gildawie Excel Discussion (Misc queries) 2 September 12th 07 09:12 PM
How can excel 2000 users open a 2007 .xlsm workbook Russ Excel Worksheet Functions 1 July 5th 07 08:53 PM
Workbook.Open Question Barb Reinhardt Excel Programming 1 June 18th 07 02:35 PM


All times are GMT +1. The time now is 06:50 AM.

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

About Us

"It's about Microsoft Excel"