Using C #, VS2005 and .NET 2.0. (XP 32 bit) This is a Winforms application that is called by a VBA (.xla) application through Interop libraries. This application has existed for some time and works great when the assembly compiles and runs in any other place except my dev machine. On dev, it will work hard (in the debugger and the object is just running) using "Unhandled exception at 0x ... in EXCEL.EXE: 0x ... place to detect 0x errors ...
But here is the weird part:
The first method in my interface works fine. All other methods work as described above. Here is a sample code:
[Guid("123Fooetc...")] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface IBar { [DispId(1)] void ThisOneWorksFine(Excel.Workbook ActiveWorkBook); [DispId(2)] string Crash1(Excel.Workbook ActiveWorkBook); [DispId(3)] int Crash2(Excel.Workbook activeWorkBook, Excel.Range target, string someStr); } [Guid("345Fooetc..")] [ClassInterface(ClassInterfaceType.None)] [ProgId("MyNameSpace.MyClass")] public class MyClass : IBar { public void ThisOneWorksFine(Excel.Workbook ActiveWorkBook) {...} string Crash1(Excel.Workbook ActiveWorkBook); {...} int Crash2(Excel.Workbook activeWorkBook, Excel.Range target, string someStr); {...} }
It seems to be a bit of an environmental one. The registry rang out? It may be a code error, but it works great elsewhere.
source share