I know some will say just use the Report Generation Toolkit, which is how we currently interact with Excel. The problem with this approach is that the various production and lab test stands use different versions of Excel (some as old as 2014) which makes deployment a nightmare because the exe will fail unless it is compiled against a compatible version of Excel due to differing property or invoke node arguments.
I have used .NET objects in LabVIEW a few times with no problems. Usually I am wrapping a downloaded dll, such as a camera driver. I have made a few useful .NET programs but I am definitely novice level with .NET.
I have downloaded and built the debug netstandrd2.0 version of ClosedXML from https://github.com/closedxml/closedxml using VSCode, no warnings or errors. The OpenXML.dll and dependencies are in a subdirectory of the LabVIEW project. All done on the same machine as the LabVIEW project.
I am able to invoke the ClosedXML.Excel.XLWorkbook constructors and access the public properties of the resultant XLWorkbook object. I am unable to access the public methods of XLWorkbook because the Invoke node wired with the XLWorkbook ref has an empty method list.
I can access the XLWorkbook.Worksheets property, wire that to an invoke node, and access the public properties and methods of the XLWorkbook.Worksheets object.
I used ILSpy to inspect the access level of the ClosedXML.Excel.XLWorkbook object methods and there are many public methods available, including the Save method I was trying to access through LabVIEW.
Probing the output wire of the LabVIEW XLWorkbook constructor node shows the following when using the ClosedXML.XLWorkbook(XLEventTracking) ctor.
Refnum (in hex): 0x94D00000
Type: XLWorkbook
ToString(): XLWorkbook(new)
HashCode (in hex): 0x02C5F37A
.NET Assemblies in Memory tool shows ClosedXML and all of its dependencies are loaded in memory.
Please let me know if you have any ideas of the next steps I need to take to solve the problem of the LabVIEW Invoke node not showing the public methods of XLWorkbook.