Has Excel stopped working with visacomlib.dll (Oct 2021)

Copper Contributor

Hello,

 

I use Excel and Word to interface to lab test equipment (oscilloscope) using visacomlib DLL from Agilent/Keysight and VBA.

Recently (Oct 2021) Excel is crashing when I try to connect the scope (or any equipment on my GPIB bus).

    Set SCOPE1.Command.IO = io_mgr.Open("GPIB:: 12")

My code is ok as it has always worked before.

Similar code in Word is working fine --> hardware interface and VISA drivers are ok.

 

Looking at the bus data using Agilent Connection Expert IO Monitor I can see the the connection to the equipment is being made but Excel crashes - monitor file attached.

 

Has Excel been changed recently that affect external DLLs?

 

Thanks,

 

D.

3 Replies

@DD_Heyday 

 

I'm a support engineer at Keysight for the IO Libraries Suite software and do see this crash occurring in MS Excel and VBA as well after our IT team push out a MS Office update on Nov 17th 2021.

I recorded a video of going through the VBA program that uses VISA-COM Library in Debug mode and the loading of the library, initialization of the Resource Manager, opening the instrument session, executing SCPI commands and closing of the instrument session and Resource Manager actually work as expected.

It is when the VBA exits the subroutine and where I assume it Garbage Collects any objects and returns back to the spread sheet is where the crash occurs.

 

I also posted this issue in another Microsoft forum: https://docs.microsoft.com/en-us/answers/questions/613052/simple-visual-basic-application-crashes-ex... 

 

Here's the video: https://drive.google.com/file/d/1sCGzJfUkPqP2mRLrpPeIQQPCdPZeDfC_/view?usp=sharing 

 @DD_Heyday 

 

  1. Managed to resolve the issue by uninstalling MS Office 365 the second time around from Programs and Features.

  2. Going to my companies IT provided MS Office 365 portal (URL was something portal.office.com and logged in with my work email).

  3. Clicking on the Install Office button and downloading a OfficeSetup.exe

  4. Running the .exe to reinstall MS Office 365 applications with Administrator privileges

  5. Reboot

  6. Launch my Excel program with the VBA code referencing VISA-COM Library 5.12 and ran it without the crash anymore.

So the bug looks to be happening when the MS Office 365 was updated and it basically breaks the Exit Sub process when objects in the VBA program are supposed to be Garbage Collected.

@DD_Heyday

 

Some other Keysight engineers managed to get some feedback from a Microsoft engineer. The following was the root cause of the crash so updating your MS Office version to the one release on January 27, 2022 and beyond should fix the issue.

 

About this problem, we had investigated the root cause with a Microsoft engineer and found the followings.

1) Excel uses the VBE7.dll to exeucte VBA program and the VBE7.dll, which file verstion is greater than or equal to 7.1.11.13 and less than or equal to 7.1.11.17, has a defect.
2) The defect is that the VBE7.dll cannot execute COMs without IDispatch interface.
3) VISA COM has an IUnknown interface, but it does not have the IDispatch interface, then VBE7.dll with the defect cannot executes the VISA COM.
4) The latest Office version, which was published at January 27 as the "Current Channel", has VBE7.dll file version 7.1.11.18 and the VBE7.dll can execute COMs without IDispatch interface.

 

Then the latest Excel can execute VISA COM.