Office 2003 automation: dll built VB VS2005 in Office 2003

A

Arseny

Hello! Please, help with VS2005-Office2003 automation.

I built very very simple project in VB VS2005 and compiled it to 'Release'
dll.
The VB project in VS2005 has COM class (and also option COM-visible checked).

After that, I add a reference to the built dll in Office 2003 (Excel or Word).
Now, I create new Sub in Office 2003 (in Excel or in Word) and in that Sub i
try to access my dll:

Sub testVb()
Dim var as vbClassLibrary.Test
Dim intvar as Integer
Set var = new vbClassLibrary.Test 'here the code fails
intvar = var.RunSimpleFunction
End Sub

The error I get while trying to create new object is "ActiveX can't create
object"

Please, help!
Thanks, in advance.
 
C

Cindy M.

Hi =?Utf-8?B?QXJzZW55?=,
I built very very simple project in VB VS2005 and compiled it to 'Release'
dll.
The VB project in VS2005 has COM class (and also option COM-visible checked).

After that, I add a reference to the built dll in Office 2003 (Excel or Word).
Now, I create new Sub in Office 2003 (in Excel or in Word) and in that Sub i
try to access my dll:

Sub testVb()
Dim var as vbClassLibrary.Test
Dim intvar as Integer
Set var = new vbClassLibrary.Test 'here the code fails
intvar = var.RunSimpleFunction
End Sub

The error I get while trying to create new object is "ActiveX can't create
object"
Mmm. Usually, I do it as follows, where the name of the DLL is COM_ClassLib_CS.
You'll notice there's no second level when declaring and instantiating the
object. I'm guessing all you need is "Test", but not knowing the file name of
the DLL I can't be certain.

Sub GetManagedFunction()
Dim ccw As VBAExtensions
Set ccw = New VBAExtensions
MsgBox ccw.getTest
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top