Invalid Refnum Class in LabVIEW Report Generation Toolkit

Updated Dec 22, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

Operating System

  • Windows

Other

  • Microsoft Office

Issue Details

I get warnings and broken arrows in the LabVIEW Report Generation Toolkit functions. 
The broken arrows are in the following files, Word_Import_Module.vi, Word_Remove_Module.vi and Word_Add_Reference_to_VBproj.vi


The error messages point towards the VI's from the Report Generation Toolkit and look like this:

 

When opening the Word_Import_Module.vi one can see that the error is due to a broken wire: 

Solution

This issue is related to a mismatch in the installation of Microsoft Office and specifically the Microsoft Word Object Library. This object library is a set of classes containing properties and methods that LabVIEW uses when making ActiveX calls to Microsoft Word through the Report Generation Toolkit. In this case, the issue is that the correct property of the Word._Document class cannot be found (VBProject).
 

The issue can be verified by creating a property node in a blank VI, right-clicking App and choosing Word._Document as shown below:

 

Click Property and find the property that is needed, in this example VBProject. If it is grayed out it is missing or is not linked correctly. 

Reinstalling the Office package component (Word) will resolve this issue. Instructions on how to reinstall Microsoft Office components can be found here: Download and install or reinstall Office 365 or Office 2019 on a PC or Mac