brazilnut52 Posted May 4, 2004 Posted May 4, 2004 Say I have a .NET project to compile to a class library (.DLL). Here is all the code in the library: Public Class GetString Public Function GetTestString() As String Return "Test String" End Function End Class In the build options, I have selected the library to be Registered for COM Interop. After compiling the project, I get both GetString.dll and GetString.tlb in the \bin folder. Now in Excel I open a new book. Go to the Vb Editor and add a reference to the GetString.tlb file in the \bin folder of my .NET solution. I then add VBA module and I put the following code: Public Sub getStr() Dim str As New GetString.GetString Dim ws As Worksheet Set ws = ActiveSheet ws.Range("A1").Value = str.GetTestString() End Sub Compile -> Save. When I run the macro, everything works perfect! The string is successfully placed in the appropriate cell. But NOW the part that has confused and frustrated me for a long time. I now take the Excel worksheet, the GetString.dll, and the GetString.tlb file and put them on another computer. The other computer does have .NET installed by the way. When I run the macro, I get the following error: Run-time error '429': ActiveX component can't create the object. This problem is a much more simplified version of what I am actually dealing with. But If someone could PLEASE tell me the exact steps to take to get this macro to work on a PC other than my own development PC, I would be very greatful. Thanks, brazilnut Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.