LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Broken root dependencies in Report Generation Toolkit for Excel

Hi all,

 

I've been having broken VIs all over due to the Report Generation Toolkit for Excel. Relinking to invoke node only fixed some of the SubVis but I've traced it to this point where there field for Property Node and Invoke Node is completely blank. According to NI troubleshooting page it's supposedly due to a bitness problem (LabVIEW 32 bit with 64-bit Office 365) but this has always worked previously and it just stopped suddenly one day. The thing is, I've uninstalled and reinstalled LabVIEW (also a nightmare to hunt down all the dependencies) and the problem persists. This problem also does not occur on a colleague's PC where they have the same LabVIEW and Office version as me.

 

Could someone maybe point out what might be the issue?

 

Thank you in advance

0 Kudos
Message 1 of 11
(567 Views)

A couple of points:

  • Tell us more about your system.  It sounds like 64-bit Windows (10?  11?), 32-bit LabVIEW (what version?), 64-bit Microsoft Office.  This combination should work, but because Microsoft is free to modify Excel without telling NI about the changes, the RGT sometimes "breaks".  When this happens, it can usually be fixed (see Point 3).
  • A small demo program that exhibits the failure and could be tried on our PCs would be helpful.  Of course, we might have a configuration of LabVIEW/Windows/Office that works, or has been patched, but we could at least see what you are trying to do.  And if we get a crash, we can try to fix it and tell you what we did.
  • Uninstalling/Re-installing LabVIEW is a gutsy proposition -- one can easily render a PC "unable to run LabVIEW without a reinstallation of Windows" (I've been there, after hundreds of successful LabVIEW installations for myself, colleagues, and Teaching Labs).

Bob Schor

0 Kudos
Message 2 of 11
(520 Views)

@Bob_Schor wrote:

A couple of points:

  • Tell us more about your system.  It sounds like 64-bit Windows (10?  11?), 32-bit LabVIEW (what version?), 64-bit Microsoft Office.  This combination should work, but because Microsoft is free to modify Excel without telling NI about the changes, the RGT sometimes "breaks".  When this happens, it can usually be fixed (see Point 3).

 



Yep, 64-bit Windows 10 Enterprise (Version 22H2), 32-bit LabVIEW ( I used both the 2020 SP1 and 2023 Q4 version and the broken dependencies appear in both), 64-bit Microsoft Office 365 (not entirely sure which version). I guess what's strange to me is that the exact same VI appears unbroken on a colleague's PC who should be having the same configuration.

 

I'm familiar with 'relink invoke nodes'. I did notice that in some of the broken property/invoke nodes, the new property type is no longer a reference type, but a variant. Those could be relinked by converting it into reference type. It's up to the point of the Excel._Worksheet / Excel._Application reference that is completely broken because that original reference is contained in a class. And when I try to place a new property or invoke node, no properties or method can be shown.

 

I attached a sample vi in a LabVIEW2020 SP1 version. Additionally I'm unable to modify the vi when I click on the broken arrow to get to the broken root dependencies, but when I open a new blank vi and place one of the Excel RGT VIs, I'm able to modify it.

 

Another thing, after repairing and/or deinstalling/reinstalling only the RGT and I create a new blank vi for the very first time, and place the RGT functions on the block diagram, everything appears fine and unbroken. It's only when I close it'll prompt me to save, including "changes in the RGT", and by saving; the next time I open the VI, all the dependencies are broken. Even if I click "don't save", the next time I open any VI that has any of the Excel RGT, it'll appear broken. 

 

Thank you in advance.

0 Kudos
Message 3 of 11
(510 Views)

There are many "mistakes" (or "missing pieces") in the Sample VI you attached.  Some are trivial (except it meant I couldn't really "test" the code), others probably show "lack of understanding" of how the Excel part of the RGT works and the best way to use it.

 

First comment:  When you write a VI, size the Front Panel to something other than "Full Screen" (unless it really is "much too big to work with").  Your Front Panel should be less than half-a-screen high, and about 15% screen wide, and its Block Diagram should be 50% screen high and <70% wide.  Get rid of excess White Space!

 

Create Report uses the "Template" input only to read an existing Excel Workbook to which you want to use the RGT to "fill in some blanks".  In your case, I assume (since I don't remember you mentioning an "input" and didn't see one attached), I assumed this was a "mistake".  If so, then the Excel Workbook Properties call doesn't make sense (it should return 1, I think, which is the default for a new Workbook).  Similarly, you don't need Get Worksheet (you'll have Worksheet Index 0).  It is fine to rename the Worksheet, but you don't need to "get" it again.

 

I never use "Append Table to Report", but use "Excel Easy Table", along with other functions to provide Header and other information.  In any case, you must provide some data (even an empty array!) to the "Write" function to avoid an error.

 

Do not use the File Dialog function with the RGT!  The "Save Report to File" takes the Report as the first input, and the file name (and path) you want for the output file as the second input.  Try wiring "My Test.xlsx" into that input and see what happens.

 

You can find a Demo program I wrote 10 years ago on the Forum that shows you how to construct a Report with various features.  If you go to the first page on this Forum and type in "Revised Generate Excel Report Example", half-way through typing "Report", the correct link to my 2014 Example should pop up.  Although the example is 10 years old, and some of the functions have been renamed, it still runs in LabVIEW 2021 (the latest version I've tested).

 

Bob Schor

0 Kudos
Message 4 of 11
(486 Views)

@Bob_Schor wrote:

There are many "mistakes" (or "missing pieces") in the Sample VI you attached.  Some are trivial (except it meant I couldn't really "test" the code), others probably show "lack of understanding" of how the Excel part of the RGT works and the best way to use it.

 

First comment:  When you write a VI, size the Front Panel to something other than "Full Screen" (unless it really is "much too big to work with").  Your Front Panel should be less than half-a-screen high, and about 15% screen wide, and its Block Diagram should be 50% screen high and <70% wide.  Get rid of excess White Space!

 

Create Report uses the "Template" input only to read an existing Excel Workbook to which you want to use the RGT to "fill in some blanks".  In your case, I assume (since I don't remember you mentioning an "input" and didn't see one attached), I assumed this was a "mistake".  If so, then the Excel Workbook Properties call doesn't make sense (it should return 1, I think, which is the default for a new Workbook).  Similarly, you don't need Get Worksheet (you'll have Worksheet Index 0).  It is fine to rename the Worksheet, but you don't need to "get" it again.

 

I never use "Append Table to Report", but use "Excel Easy Table", along with other functions to provide Header and other information.  In any case, you must provide some data (even an empty array!) to the "Write" function to avoid an error.

 

Do not use the File Dialog function with the RGT!  The "Save Report to File" takes the Report as the first input, and the file name (and path) you want for the output file as the second input.  Try wiring "My Test.xlsx" into that input and see what happens.

 

You can find a Demo program I wrote 10 years ago on the Forum that shows you how to construct a Report with various features.  If you go to the first page on this Forum and type in "Revised Generate Excel Report Example", half-way through typing "Report", the correct link to my 2014 Example should pop up.  Although the example is 10 years old, and some of the functions have been renamed, it still runs in LabVIEW 2021 (the latest version I've tested).

 

Bob Schor


Thank you, it was copy and pasted from an existing program which used to work and I changed many of the inputs to controls/constants. The 'Get Worksheet' was for a different sheet, and yes it was a mistake to wire the same constant in my haste. The front panel would not be that big as well 

 

The File Dialog is to get the user to choose to rename the document and/or location.

 

They are very fine tips but they don't really address my problem of broken dependencies in the Excel RGT functions. Is the VI also broken for you?

 

By the way, your Excel Demo.vi also shows up as broken for me, despite replacing the NewReport.vi to CreateReport.

0 Kudos
Message 5 of 11
(475 Views)

OK, thanks to your response, and my running another test, I think I understand your situation.

 

You asked if I'd run your demo.  First of all, I couldn't run it in LabVIEW 2019 (my "go-to" version), but was able to at least open it and examine it in LabVIEW 2021 (my "newer" version that I'm using for "solo" projects).  I initially had a breakpoint after the Excel Worksheet Properties VI (which you don't need, and I didn't understand its purpose), but I just ran the entire routine and got a very nice empty WorkBook named as I specified it.  I also ran my Demo without failure (if I remember, I'll attach a picture of the output).

 

Here's what I (strongly) suspect -- you have a corrupt LabVIEW installation (unfortunately, relatively easy to accomplish).  There is a solution that does not take a lot of time, is safe, and will (probably) fix your problem.  The basic idea is that you completely uninstall National Instruments software (it appears in Control Panel as "National Instruments", which is why I'm not calling it "LabVIEW"), then re-install just the versions that you will be using.  The "dangerous" step is the first one -- I'll outline the (only?) safe way to do this, but being "more aggressive" will probably require reinstalling Windows in order to get LabVIEW to run again!

 

Oops, before you start "removing", be sure you'll be able to re-activate NI software.  You should be able to find the License information by opening NI License Manager and looking at your Licenses and Serial Numbers.

 

Here are the steps:

  1. Open "Control Panel".  This Windows 7 tool is what I use for removing software.  You can find it by clicking the "Start" button in the lower left-hand corner of the screen and typing "Control Panel".
  2. Select "Programs and Features".  This brings up the Windows "Uninstaller".
  3. Scroll down to find "NI Software".  It should be right below "NI Package Manager".
  4. Click "NI Software", which should bring up NI Package Manager (you need Admin rights to do this).  Uncheck "Products Only" (near the top, under "Updates"), click the "Name" box (to the left) to select everything, and choose "Remove".  Click enough "OK"s to start the process, which will take several (dozen?) minutes.  Reboot.
  5. Repeat Step 4, as there is (older) NI Software that NIPM might not know about.  Select everything, remove, reboot.
  6. Back to Control Panel, Programs and Features.  Select NI Package Manager.  At this point, you should have no installed LabVIEW software on your PC.  There may be some folders with NI stuff, but it is much safer to let them be, as they'll probably be over-written in the re-install (which is "safe").  Removing NIPM removes the "uninstaller", and NI will warn you about this, but it should be safe if you've done the steps above.
  7. After another reboot, do a final Control Panel and make sure that the two NI entries are gone.

Now you can go to NI Downloads and load the version(s) of LabVIEW you want to run.  My recommendation would be to install no more than two versions, probably not the latest (unless there's a "feature" you need).  I recommend installing 32-bit versions of LabVIEW, though NI (I think) is pretty close to having "almost everything" working in a 64-bit version (I'd be curious as to advantages/disadvantages between 32 and 64-bit).

 

Bob Schor

Message 6 of 11
(462 Views)

In my original post I mentioned uninstalling and reinstalling LabVIEW which did not solve the problem. Neither did uninstalling and reinstalling Office. I guess the only option now is to reset and reinstall windows on the PC

0 Kudos
Message 7 of 11
(442 Views)

In your original post, you said "I've uninstalled and reinstalled LabVIEW (also a nightmare to hunt down all the dependencies) and the problem persists."  If you used NIPM to uninstall LabVIEW, there would be no "dependencies to hunt down", and if you did go through the "nightmare" to do so, you probably removed something that shouldn't have been touched.  [I did this, twice, in 2017, when NIPM was introduced.  Two different machines, two sets of "Backup Profile, get Installation Disks, reformat C: Drive, install Windows + Utilities + Profile" and not make the same mistake a third time (so far, I haven't, and I've done several re-installs since then, often in VMs, even safer ...).

 

Bob Schor

0 Kudos
Message 8 of 11
(420 Views)

@Bob_Schor wrote:

In your original post, you said "I've uninstalled and reinstalled LabVIEW (also a nightmare to hunt down all the dependencies) and the problem persists."  If you used NIPM to uninstall LabVIEW, there would be no "dependencies to hunt down", and if you did go through the "nightmare" to do so, you probably removed something that shouldn't have been touched.  [I did this, twice, in 2017, when NIPM was introduced.  Two different machines, two sets of "Backup Profile, get Installation Disks, reformat C: Drive, install Windows + Utilities + Profile" and not make the same mistake a third time (so far, I haven't, and I've done several re-installs since then, often in VMs, even safer ...).

 

Bob Schor


I used the NIPM to uninstall and reinstall LabVIEW, granted it wasn't exactly the steps you mentioned. I first opened the NIPM, uninstalled LabVIEW, any related NI products in the Control Panel-Uninstall Programs, and then NIPM itself. I also tried deleting all NI-related folders (which was probably a mistake). In any case, while reinstalling, there was an error and after troubleshooting that I had to go into the registry to delete some dll before the re-installation could proceed. And then afterwards, the VIs remained broken.

 

In any case IT wiped my PC and reininstalled Windows, and I reinstalled LabVIEW and now it works. 

 

Thank you for your time and I hope your detailed steps would help someone.

Message 9 of 11
(405 Views)

Thank you for your post.  You precisely described my 2017 experience, where I "over-uninstalled" LabVIEW and ended up wiping my C: drive and "starting over".  I have tried (many times) in this Forum to say "There is only one safe way to remove LabVIEW that will allow you to reinstall it", but sometimes the warning comes too late ...

 

Glad you are back up and running!

 

Bob Schor

0 Kudos
Message 10 of 11
(394 Views)