![]() |
Unhandled Exception in Mso9.dll when Using XlCoerce with Excel 200
SYMPTOMS
When I use XlCoerce in a dynamic-link library (DLL) that is loaded by Microsoft Excel 2000, the following error message appears €śUnhandled exception in EXCEL.EXE (MSO9.DLL): 0xC0000005: Access Violation.€ť CAUSE I am developing an XLL in Microsoft C++ 6.0 for Excel 2000. In my design Excel calls my XLL function. Excel crashes when I try to use €śExcel4( xlCoerce, €¦€ť in my XLL function to coerce a reference XLOPER (xltypeRef) that refers to a two dimensional range that contains text and empty cells. Excel crashes in two different ways: 1) right in xlCoerce function if the function is called after I select the Excel cell with XLL function click F2 and ENTER, 2) when I return control from the XLL function back to Excel if XLL function was called as the result of manually changed Excel cell that is input for the XLL function. I looked on Internet to see if anyone had the same problem but I did not find anything. The closest I could find was: 1. Microsoft article €ś"Unhandled Exception in Mso97.dll" When Using XlCoerce with Excel 97€ť: http://support.microsoft.com/kb/q166287/ But this article says that it applies to Excel 97 and was fixed in Excel 97 SR-1 but I am using Excel 2000 SP-3. 2. The second Microsoft article is €śFIX: Excel 2000 May Fault in MSO9.DLL When Calling an XLL Function that Takes an Array€ť because I do pass xltypeMulti|xltypeNum array: http://support.microsoft.com/default...b;en-us;304442 But again it is not exactly what I have. The article says that the crash appears in the following condition: €śWhen Excel prepares to call an XLL function during a recalculation, Excel calculates all dependent cells that are needed to produce the arguments to pass to the XLL function. If one of the dependent cell values is changed by outside code (such as DDE or Automation) after this calculation, but before the XLL function is called, Excel must postpone the XLL call and again recalculate the dependent cells€ť. I do not have a calculation of dependent cells in my spreadsheet as described above. All I have is one XLL function in the spreadsheet that takes 13 parameters and all input parameters are plain number, text or empty cells in forms of individual cells and ranges. Did anyone have the similar problem? What did you do? Do you have any ideas on how to solve this? If there is no fix then I have to write a function that will loop through the xltypeRef and retrieve each cell value in a range individually €“ I hope it will work! Thank you very much! |
All times are GMT +1. The time now is 06:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com