Hi all,
I have also posted this appeal for help to a google group, but I don't see much activity there. This forum seems more on target for my problem.
I am trying to access .Net components from Excel 97. For testing I am following an example presented in a 2001 posting by Manish Mehta at:
http://www.c-sharpcorner.com/articles/accessingdotnetfromcom.asp
Source code for the VB.Net component is:
imports system
namespace CCWComponent
public class CCWClass
public function PassStr as string
PassStr = "Hi from .Net Component"
end function
end class
end namespace
I compile the above with: 'vbc /t:library testCCW.vb' and register with: 'regasm testCCW.dll /tlb:testCCW.tlb'. (The /tlb switch is used to allow testing of early as well as late binding.)
When I open the VB Editor in a new Excel 97 workbook and navigate to Tools/References, a reference to 'testCCW' does show up.
Within the workbook I create the following macro to invoke the CCWClass.PassStr method when the workbook is opened.
Private Sub Workbook_Open()
Dim o As Object
Set o = CreateObject("CCWComponent.CCWClass")
MsgBox o.PassStr
End Sub
The problem is that when I open the workbook the following error appears with the macro stopped at the 'Set o = ...' statement.
Run-time error '-2146232576(80131700)':
Automation error
I am pretty much clueless about how to locate the source of this problem. Any information or suggestion about resolving it would certainly be appreciated.
Ennis

Andreas Scheu3 reputationPosted Jan 29, 2006, 11:37 PM EST
we seemed to have a similar Problem, this is what I have found so far:
the Problem is, that you need a PIA (Primary Interop Assembly), this is different for all Versions of Excel. In Excel 97 you can build it up yourself. The following Article should help you:
http://msdn.microsoft.com/office/archive/default.aspx?pull=/library/en-us/odc_of2003_bk/html/officeinteroperabilitych2_part1.asp
It should be the right thing (although it is for C#). If I have further news for you I'll post it here.
Please post if you have found a good solution.
Andy_S