LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling VBA active X from Labview

Hi guys and gals,

 

I am having some trouble implementing active x dlls with LV.  I have successfully done this before using different dlls.  What I have is VBA code which creates objects of type class and makes calls to the classes to control an instrument.  I'm trying to port the code from VBA to LV using the active x controls.  I can open the "devices" such as Stage, Microscope, Focus, etc. without any errors in LV using Automation Open.  The problem occurs when I try to open the control dll.  I keep getting the "Class not registered" error.  The manufacturer included an .exe file which registers all the dlls.  Since the VBA code runs fine, I'm a little confused as to what could be causing the error and why some automation calls succeed and other don't.  I have tried both using the .exe to register the dlls and manually using regsvr32.  I have even /RegServer the .exe that calls the functions.  I'm just stumped.

 

Cheers,

Shivels

0 Kudos
Message 1 of 4
(3,265 Views)

Hi shivels,

 

Who is the manufacturer/author of the DLLs you are trying to access? Are you trying to access hardware in any way? Can you elaborate on the "devices" you can open, such as Stage, Microscope, and Focus?

 

Aaron P

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 2 of 4
(3,225 Views)

Hi Aaron,

 

The DLLs are written by a company called Zeiss.  Zeiss makes automated light microscopes.  What I'm trying to do is upgrade a program written in VBA.  Zeiss provides VBA code to interface with their microscope, but the VBA is limiting what we can do with the machine.  Using VBA, I can browse the objects and see which DLLs and typelib's are required to call a function.  Included with their software is a program which registers all the DLLs for you.  I've tried to create a LV program which follows the same logic as the VBA code.  I'm attaching a sample VBA file which shows how the functions are declared and the LV program I am working on.

 

Cheers,

Shivels 

Download All
0 Kudos
Message 3 of 4
(3,216 Views)

Hi guys,

 

I've been doing some trail and error and have a few questions.  If I try and use the "Call Library Function Node" selecting the dll that contains the VB commands, I only get the DLLUnload, Load, etc. options.  I've been reading about wrapper DLL, but I don't think I need to use one in this case because I can see all of the commands I need to use, but I just keep getting the "Class not registered error"  But I know 100% that the class is registered because I checked the registry and the GUID shows up in there.  I'm completely puzzled about this.

0 Kudos
Message 4 of 4
(3,181 Views)