Just some info.. Using -4167 as a parameter to the add() method means that you're trying to create a workbook with one single sheet of type xlWBATWorksheet.
Copied from the VBA-docs: """ Add Method (Workbooks Collection) Creates a new workbook. The new workbook becomes the active workbook. Returns a Workbook object. Syntax: expression.Add(Template) expression Required. An expression that returns a Workbooks object. Template Optional Variant. Determines how the new workbook is created. If this argument is a string specifying the name of an existing Microsoft Excel file, the new workbook is created with the specified file as a template. If this argument is a constant, the new workbook contains a single sheet of the specified type. Can be one of the following XlWBATemplate constants: xlWBATChart, xlWBATExcel4IntlMacroSheet, xlWBATExcel4MacroSheet, or xlWBATWorksheet. If this argument is omitted, Microsoft Excel creates a new workbook with a number of blank sheets (the number of sheets is set by the SheetsInNewWorkbook property). Remarks If the Template argument specifies a file, the file name can include a path. """ Amund Tue, 5 Oct 2004 13:28:52 +0200 skrev Matt Benic <[EMAIL PROTECTED]>: > > It seems to have something to do with our AOS server. I have managed to > run > the app using a fat client, but not a thin client, in any environment. > > Regards, > > Matt Benic > Axapta Developer > UTi Sun Couriers Division > > "The universal aptitude for ineptitude > makes any human accomplishment an incredible miracle." > - Col. John P. Stapp > > > -----Original Message----- > From: Matt Benic [mailto:[EMAIL PROTECTED] > Sent: 05 October 2004 10:25 AM > To: [EMAIL PROTECTED] > Subject: RE: [development-axapta] Wierd Excel COM behavior > > > > > I tried removing the variant parameter: > > //variant.int(-4167); > //workbook = workbooks.add(variant); <-- crashes here > workbook = workbooks.add(); <-- crashes here > > And now I get the following callstack later on in the code: > Error executing code: COM object not initialised. > Stack trace: > (C) \Classes\COM\value > (C) \Classes\SysExcelCell_2000\value - line 8 > (C) \Classes\CreateCreditNoteCustTransExcel\generateHeader - line 10 > (C) \Classes\CreateCreditNoteCustTransExcel\run - line 28 > (S) > \Classes\CreateCreditNoteCustTransExcel\CreateCreditNoteCustTransExcel - > line 6 > (S) \Classes\CreditNoteCustTransRunBase\run - line 7 > (S) \Classes\CreditNoteCustTransRunBase\main - line 6 > (S) \Classes\MenuFunction\runServer > > Regards, > > Matt Benic > Axapta Developer > UTi Sun Couriers Division > > "The universal aptitude for ineptitude > makes any human accomplishment an incredible miracle." > - Col. John P. Stapp > > > -----Original Message----- > From: Don Price [mailto:[EMAIL PROTECTED] > Sent: 04 October 2004 05:05 PM > To: [EMAIL PROTECTED] > Subject: RE: [development-axapta] Wierd Excel COM behavior > > > > > Hi Matt, > > Why are you passing in the variant? I took a quick look at one of our > classes and we just call the add with no parms. Maybe Office 2003 > requires your parm? > > Don > > -----Original Message----- > From: Matt Benic [mailto:[EMAIL PROTECTED] > Sent: Monday, October 04, 2004 9:27 AM > To: Axapta Dev > Subject: [development-axapta] Wierd Excel COM behavior > > > > Hi there, > We have a report that is explicitly written to an excel file (rather > than > using the query engine). This report has been running fine until we made > some changes last week. Now it works on our dev and test systems, but > crashes on our live system. It fails on addition of a workbook to a > workbooks object: > > in class CreateCreditNoteCustTransExcel that extends > SysExcelApplication_2000: > > //Get workbooks object from the app > workbooks = application.workbooks(); > > //Add a new workbook > variant.int(-4167); > workbook = workbooks.add(variant); <-- crashes here > > Any idea why this would happen? The crash is so bad that the client > crashes, > but does not happen if the client is connecting to our dev or test > system. I > cannot debug into this line and there is no useful output (just the > error > message below): > "Your Navision Axapta session cannot continue due to a fatal error > condition. An Unrecoverable error occurred while the Object Server tried > to > process the last request. Please start again and retry the operation. If > the > problem persists please notify your Navision Axapta administrator." > There is nothing in the log folder or in the app or sys event logs. > > > Regards, > > Matt Benic > Axapta Developer > UTi Sun Couriers Division > > "The universal aptitude for ineptitude > makes any human accomplishment an incredible miracle." > - Col. John P. Stapp > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > Yahoo! Groups Links > > To visit your group on the web, go to: > http://groups.yahoo.com/group/development-axapta/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

