Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
Excel 2003 fails to calculate cells correctly | Excel Discussion (Misc queries) | |||
Excel 2003 Fails to open template | Excel Discussion (Misc queries) | |||
excel 2000 fails to open excel 2003 file | Excel Discussion (Misc queries) | |||
Workbook fails to open - Excel 2003 | Excel Discussion (Misc queries) |