'Regasm.exe' is not recognized as an internal or external command,
operable program or batch file.
Where do I get this program?
I am trying to put a collection of functions that I use a lot in a DLL to be used in Access 2007 and Excel 2007.
The entire code for a test DLL project is listed below.
I tried using this command: regsvr32 Test1.dll
I got this error message : Test1.dll was loaded, but DllRegisterServer entry point was not found. This file connot be registered.
I tried declaring it like this inside Access 2007:
Declare Function fnSR Lib _
"C:\Documents and Settings\userA\My Documents\Visual Studio 2008\Projects\Test1\Test1\
Alias "fnSqrt" (ByVal dDblIn As Double) _
As Double
From the immediate window I type: ? fnSR(9)
I get run-time error 453: Can't find DLL entry point fnSR in C:\Documents and Settings\userA\My Documents\Visual Studio 2008\Projects\Test1\Test1\
Info on my the VB I am using:
Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: VB Express
Microsoft Visual Basic 2008 91908-152-0000043-60625
Microsoft Visual Basic 2008
So, how can I get this function to work inside Access 2007?
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'll try that. However, check this out.
I noticed that TestClass1 attributes COM Class and COM Visible needed to be set to true. After I did that it chaged my source code. Notice "
<Microsoft.VisualBasic.Com
'Microsoft.VisualBasic.Com
OK. Making progress.
Now when I goto MS Access I can find the Test1 library to reference and use in VBA. The attached code is function I wrote in VBA in a Access module. It runs with out error. However, as you can see it does a whole lot of nothing.
The problem is: the fnSqrt function is NOT visible. How do I declare that function to make it visible?
Making more progress! Using some examples I've come up with what you see below. Now the fnSqrt function IS visible in MS Access.
I use this to rigister the DLL:
C:\WINDOWS\Microsoft.N
After that I see 'Test1' can be added as a reference in MS Access.
Here is my function in MS Access:
Function TestTest1() As Double
Dim T1 As New TestClass1
Debug.Print T1.fnSqrt(9)
Set T1 = Nothing
End Function
From the immediate widow I try to run the function:
? TestTest1()
An error message box pops up now:
Run-time error '-2147024894 (800700002)':
Automation error
The system cannot fine the file specified.
I found this on another web site.
"Actual
ly, I ended up using the /codebase option with the regasm, and it
started working! I got this help in another forum.
This worked even though I hadn't given the DLL a strongname. There is a
warning when I use regasm that if the DLL doesn't have a strongname it could
interfere with others on the computer; for my particular case this is not a
problem as I will always ever use this one version ONLY (and hopefully will
before too long be replacing the entire VB6 app, so this is a temporary
measure. But there are few temporaries in the world of released software....)
Also, as far as I know you need to unregister and reregister the DLL every
time there's a change, even if the interface doesn't change. Again, this is
not a problem in our case; the batch files to register unregister seem to
work very reliably.
Hope this works for others as well."
</EM> I added the code base switch when I call regAsm:
C:\WINDOWS\Microsof
I WORKS in MS Access now!
I guess the last thing to know is how do I give my DLL a "strong name"
Here is the warning from RegAsm:
RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.
Types registered successfully
Business Accounts
Answer for Membership
by: HBHoffmanPosted on 2009-07-29 at 11:30:37ID: 24973082
You need to use Regasm.exe to register your .Net dll.