Answer the question
In order to leave comments, you need to log in
Why can't I use an assembly registered in the system?
I wrote a library in c#, I want to use it in MS Access using COM tools.
The essence of the problem is that if I register my assembly in the system using Visual Studio, I can use it in MS Access by simply pointing reference to it, and then refer to it using VBA. But if I do it manually using regasm or tlbexp, then when I try to call any classes from the assembly, I get an error in RunTime: The specified file cannot be found.
Registration options:
However, by checking the checkbox to register the assembly through VS, I can use the assembly without any problems.
Example source code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ClassLibrary1
{
[ComVisible(true)]
public class Class1
{
public string getTest()
{
return "Test Success";
}
}
}
Option Compare Database
Private Sub Button0_Click()
Dim test As TestBuild.Class1
Set test = New TestBuild.Class1
Debug.Print test.getTest
End Sub
Answer the question
In order to leave comments, you need to log in
Purely theoretically, because there is nowhere to check now. Office 64 bit? If yes, then the assembly must also be 64 bit and register via "%Windir%\Microsoft.NET\Framework64\v2.0.50727\regasm" "$(TargetPath)" for version 2 net
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question