Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Workbooks.Open not working from a service on Vista

Bit of an odd one, but I cannot figure out why the Workbooks.Open command
produces an exception (see below) only when the command is run from a windows
service running on Vista.

So far I have discovered the following:
1. Its not version specific to Exel, I get the same result on version 2003
and 2007.

2. I can "see" and fully access the workbook from the service. I've done a
few tests involving using Shell to launch Excel with the workbook as well as
creating new files from the service, which both worked ok.

3. Ive tried late binding to the Excel application and invoking the Open
method, same exception.

4. I've verified that my code is working ok in a console app.

From looking up on the internet the exception is quite a generic one, as in
"something hasn't worked, i'm failing now", but heres the exception:

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office
Excel cannot access the file 'C:\TestExcelService\Test_Excel.xlsx'. There are
several possible reasons: €¢ The file name or path does not exist. €¢ The file
is being used by another program. €¢ The workbook you are trying to save has
the same name as a currently open workbook. at
Microsoft.Office.Interop.Excel.Workbooks.Open(Stri ng Filename, Object
UpdateLinks, Object ReadOnly, Object Format, Object Password, Object
WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object
Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru,
Object Local, Object CorruptLoad)

If anybody has any ideas on how to fix this I'd really appreciate it.
Thanks
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Workbooks.Open not working from a service on Vista

I'm taking some guesses. With Excel 2003 try verifying the Default
directory. You may not have permissions for this directory.

from worksheet menu
tool - Option - General

Also see if the problem occurs on more than one PC. I would also check if
the Excel file is corrupted by going to Recover Application tool

Start - Microsoft Office - Tools - Recover Application.

"Mark B" wrote:

Bit of an odd one, but I cannot figure out why the Workbooks.Open command
produces an exception (see below) only when the command is run from a windows
service running on Vista.

So far I have discovered the following:
1. Its not version specific to Exel, I get the same result on version 2003
and 2007.

2. I can "see" and fully access the workbook from the service. I've done a
few tests involving using Shell to launch Excel with the workbook as well as
creating new files from the service, which both worked ok.

3. Ive tried late binding to the Excel application and invoking the Open
method, same exception.

4. I've verified that my code is working ok in a console app.

From looking up on the internet the exception is quite a generic one, as in
"something hasn't worked, i'm failing now", but heres the exception:

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office
Excel cannot access the file 'C:\TestExcelService\Test_Excel.xlsx'. There are
several possible reasons: €¢ The file name or path does not exist. €¢ The file
is being used by another program. €¢ The workbook you are trying to save has
the same name as a currently open workbook. at
Microsoft.Office.Interop.Excel.Workbooks.Open(Stri ng Filename, Object
UpdateLinks, Object ReadOnly, Object Format, Object Password, Object
WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object
Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru,
Object Local, Object CorruptLoad)

If anybody has any ideas on how to fix this I'd really appreciate it.
Thanks
Mark

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
duplicate workbooks open while working in that file rob86021 Excel Discussion (Misc queries) 2 October 16th 07 09:24 PM
Merge Sheets not working in Vista SA Roberts Excel Discussion (Misc queries) 0 July 13th 07 07:48 PM
Workbooks.Open(URL) not working [email protected] Excel Programming 3 October 2nd 06 05:20 PM
Problem with Macro working in new workbooks that I open chris_rip Excel Programming 2 March 29th 05 05:19 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM


All times are GMT +1. The time now is 10:31 PM.

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"