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: 

How can I control equipment from Excel VBA using NI-VISA GPIB and USB?

Solved!
Go to solution

Firstly, apologies if this is discussed elsewhere, but I haven't been able to find it.

 

I used to have a load of Excel macros that would control and read data from equipment over GPIB.  However, for some reason this has stopped working since a recent update to NI-VISA 15.0.  I tried downloading NI-VISA 3.0 but it would not install, I guess on the basis that a later version is already on the pc, or maybe because I'm on Windows 10.

 

I have added references to VISA.COM 5.5 and VISA COM 488.2 Formatted I/O 5.5.  Now when I try to run the macro, I get the response "User-type not defined" to the line:

 

Public defaultRM As ViSession

 

If this is no longer supported, I think that it's a shame as it was very useful being able to get data straight into Excel from a spectrum analyser using single Ctrl+key-press.

 

Thanks for any help.

0 Kudos
Message 1 of 3
(5,862 Views)

Look for examples for VB6.

 

I haven't used Windows 10 in a corporate environment, so I haven't kept up with compatibility of Windows 10 and NI software.

This is something you as the engineer will need to investigate.

0 Kudos
Message 2 of 3
(5,833 Views)
Solution
Accepted by MikeLSAEM

"Public defaultRM As ViSession" is not for VISA COM.

 

That's for the VISA32 API.

 

 

 

Message 3 of 3
(5,742 Views)