Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Worksheets Add fails with SP1 of Excel 2003

Adding a new worksheet using the Worksheets Add method throws an exception
with error code 0x80010105 (RPC_E_SERVERFAULT - "The server threw an
exception.").
The code (in C++) looks like this:

Worksheets sheets;
sheets = book.GetWorksheets();
sheet = sheets.Add(covOptional, covOptional, covOptional, covOptional);

This code works without problems with Excel 2000 and 2002.
It also worked with Office 2003 without SP1. After installing SP1 however
the program fails the way described above.

I am running Windows XP SP1 + Office Professional Edition 2003.
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Worksheets Add fails with SP1 of Excel 2003

After some investigation the problem seems to be related to the fact that
Excel is not the active view, when the Worksheet is added. With SP1 installed
this method now fails.

I produced a small example program, an MDI application created with MFC,
where one of the views is an in-place activated Excel workbook.
A command in the File menu calls the Worksheets Add method on the Excel
view. The example demonstrates that this method fails if Excel is not the
active view.
This worked for all previous version of Excel, but not anymore with SP1
installed.

Unfortunately the workaround to always activate the Excel view during this
operation, is not possible in our real application.


"OliverS" wrote:

Adding a new worksheet using the Worksheets Add method throws an exception
with error code 0x80010105 (RPC_E_SERVERFAULT - "The server threw an
exception.").
The code (in C++) looks like this:

Worksheets sheets;
sheets = book.GetWorksheets();
sheet = sheets.Add(covOptional, covOptional, covOptional, covOptional);

This code works without problems with Excel 2000 and 2002.
It also worked with Office 2003 without SP1. After installing SP1 however
the program fails the way described above.

I am running Windows XP SP1 + Office Professional Edition 2003.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Worksheets Add fails with SP1 of Excel 2003

adding this for posterity mostly because i have the identical problem and
cant find any documentation anywhe
this code replaces the "sheets.add" code that throws the error in excel 2003
with sp1:
'xlb is the workbook
xlb.Parent.Windows(xlb.Name).Visible = True
Set xls = xlb.Sheets.Add(After:=xlb.Sheets(xlb.Sheets.Count) )
xlb.Parent.Windows(xlb.Name).Visible = False

i havent tested it to see if it works in excel 97-2002, but it should

"OliverS" wrote:

Adding a new worksheet using the Worksheets Add method throws an exception
with error code 0x80010105 (RPC_E_SERVERFAULT - "The server threw an
exception.").
The code (in C++) looks like this:

Worksheets sheets;
sheets = book.GetWorksheets();
sheet = sheets.Add(covOptional, covOptional, covOptional, covOptional);

This code works without problems with Excel 2000 and 2002.
It also worked with Office 2003 without SP1. After installing SP1 however
the program fails the way described above.

I am running Windows XP SP1 + Office Professional Edition 2003.
Thanks

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel 2003 fails to calculate cells correctly Toi Excel Discussion (Misc queries) 2 May 7th 07 06:47 AM
Excel 2003 Fails to open template Geroge Excel Discussion (Misc queries) 2 February 27th 07 09:37 PM
excel 2000 fails to open excel 2003 file noggins Excel Discussion (Misc queries) 0 October 17th 06 04:15 PM
Workbook fails to open - Excel 2003 nc Excel Discussion (Misc queries) 1 February 2nd 06 06:33 PM


All times are GMT +1. The time now is 12:01 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"