From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa library objekt reference not listed in VBA under WIN7

Hi Community!

 

I have a VBA Script using the VISA32.DLL.

The Script includes the "VISA.BAS" and an object reference to "Visa Typelib" is set, its works fine with WinXP. 

 

Now I am trying to get it working with WIN7 (32Bit).

I installed the same Package Ni-VISA_5.3_full.

"Visa32.dll" is in the expected folder ( Windows/system32/ ..) but the "Visa Typelib" is not listed in the VBA Objekt reference browser anymore.  

 

 

Under XP there are registry entries like these:

 

   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}]
   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}\3.1] @="VISA Library"
   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}\3.1\0]
   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}\3.1\0\win32] @="C:\\WINDOWS\\system32\\visa32.dll"
   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}\3.1\FLAGS] ="0"
   [HKEY_CLASSES_ROOT\TypeLib\{39C32428-25DB-11D0-85B4-0020AF33DEAE}\3.1\HELPDIR] @="C:\\WINDOWS\\system32"

 

With WIN7 there are none of such entries.

Un-and reinstalling the Ni-Visa Stuff does not help.

 

 

Locking forward for an expert recovering me from running crazy 🙂

 

 

 

 

 

 

 

 

 

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

Which program are you using to run your VBA Script?

Did you integrate your dll in your program?

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

I solved it.

 

I had used code snippets from older NI VBA Samples. Therein were some type definitions like "viStatus", "viFindList" or "viSession".

With XP i had involved an objekt reference to a "Visa Typelib", which was part of the NI VISA Installation. With WIN7 this reference wasn't there anymore. 

 

Found out that all this "vi...." are simply the VBA Type "long". After replacing the stuff my script works fine now with VISA and WIN7. Finally I studied actual

NI VBA Samples, they use "long" as well instead of the "viWhatEver...".

 

The programm I am using is HBM CatManEasy AP, it employes the VBA compatible "Sax Basic Engine". But Itried with Exel VBA as well and had the same problem.

 

Thanks for taking care of this matter!

 

 

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