LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ActiveX Excel automation, LV2019SP1 32-bit, corporate Office 365/Excel 2016

Solved!
Go to solution

I’ve discovered that I have some sort of problem with my corporate laptop’s installation of Office/Excel with respect to LabVIEW.  None of the ActiveX automation stuff seems to work, at all – I get back a pretty generic error and so far am stumped as to cause.  This means none of the Report Generation toolkit VIs work.  As far as I can verify, the Report Generation toolkit is properly installed and licensed on both my LV 2019 SP1 and my LV 2020 installations.

 

I’ve actually troubleshot it to beneath the toolkit anyway – if I just drop an ActiveX reference on the diagram, I can browse to the type library “Microsoft Excel 16.0 Object Library 1.9” and get a reference to “Application (Excel.Application.16)”.  It’s when I wire that to an Automation Open node and run that I get an error (-2147319765, or x8002802B), which just says “Element not found”.  I’m not having much success online with searching Microsoft for this error.

 

System OS is Win10 Enterprise (10.0.17763), x64, and LabVIEW is 19.0.1f3 (32-bit).  My Excel version (File->Account->About Excel) shows “Microsoft Excel for Microsoft 365 MSO (16.0.13127.21062) 32-bit”.

 

I wondered if this was some limitation of Excel under an Office subscription plan, so I checked on my home PC (has pretty close specs - Win10 Pro x64, an Office 365 home subscription and the identical Excel release) and LabVIEW Community Edition installed there appeared to work fine for opening an Excel.Application reference.  However, on closer inspection, it appears to actually be using the "Excel.Application.14" selection - so it's finding an old copy of Excel 2010 lingering on my home PC (not even licensed/activated).  Unsure how to remove it from consideration.

 

Sorry, long description, but wanted to be thorough – can anyone confirm that they are able to successfully open an ActiveX reference to Excel 2016 release and report same back to me?

 

Thanks,

Dave?

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 1 of 11
(6,762 Views)

Seeing the same sort of error here too with Word and Excel.

0 Kudos
Message 2 of 11
(6,683 Views)
Solution
Accepted by topic author DavidBoyd

I should've circled back on this - I fixed the issue, you may want to try this:

 

Windows Settings->Apps->Apps & Features->Microsoft 365 Apps for enterprise - en-us [localization may vary, I suppose]

 

Choose "Modify" (accept UAC elevation request)

"Quick Repair" option

 

...aaand just like that, my problem went away.  I can automate Excel just fine now.

 

Though I've since been all over the Windows event logs, poked around in my AppData subfolders looking for recent text logs, etc, looking for an answer to "what needed repair, exactly?" with no results.  I hate mysteries like this.

 

Hope this helps!

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 3 of 11
(6,660 Views)

I finally was able to get my IT department to log in and do an Office 365 Repair.


This seemed to work. What a pain that for every Office rollout I may have to do this!

 

Thanks for your help.

0 Kudos
Message 4 of 11
(6,612 Views)

I suggest you to avoid Report Generation toolkit that uses a deprecated tech (ActiveX).

 

You can manipulate (create/edit/open/save) Word and Excel files without any Microsoft software installed.

 

Office file format was open sourced years ago, there is ZERO (legit ZERO) need of ActiveX

 

Just google "NPOI" or "NPOI Labview"

Message 5 of 11
(6,601 Views)

@DavidBoyd wrote:

Windows Settings->Apps->Apps & Features->Microsoft 365 Apps for enterprise - en-us [localization may vary, I suppose]

Choose "Modify" (accept UAC elevation request)

"Quick Repair" option

...aaand just like that, my problem went away.  I can automate Excel just fine now.

Thank you Dave for sharing your findings. 

I had the same problem and a repair resolved it.

 

Thanks,

UliB

0 Kudos
Message 6 of 11
(6,588 Views)

@Konan__ wrote:

I suggest you to avoid Report Generation toolkit that uses a deprecated tech (ActiveX).

 

You can manipulate (create/edit/open/save) Word and Excel files without any Microsoft software installed.

 

Office file format was open sourced years ago, there is ZERO (legit ZERO) need of ActiveX

 

Just google "NPOI" or "NPOI Labview"


Yes I abandoned any type of ActiveX years ago when applications would run on one machine and not on another due to ActiveX issues...

 

I recommend the XLR8 add-on if you really must read and write directly to Excel

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 11
(6,584 Views)

Glad that worked for you.  So today I gave myself a virtual pat on the back by accepting my own reply as the solution.  First time I ever did that.

 

As to the others suggesting you get away from the Office automation/Report Generation toolkit - I generally agree with them.  Full disclosure - I'm actually using the XLR8 toolkit to generate my .XLS output files.  Overall, it seems to work very well (it's NPOI-based), but unfortunately for my case, I'm required to also invoke a VBA macro for some processing post-data-collection.  So I'm still stuck to using Excel on the target system, I'm unaware of a non-Microsoft solution to execute VBA in an Excel file.

 

Also, and please anybody correct me if my impression is wrong, NPOI seems to primarily support xlsx format (the zipped XML format), with classic .xls as a bit of an afterthought.  I am also constrained to use old original .xls, along with its file password protection scheme, for which NPOI has no support.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 8 of 11
(6,572 Views)

All of what I do is with Word. I need to create written Word reports that contain our testing data that then become part of a bigger Word document of all the testing we do here in the lab.

0 Kudos
Message 9 of 11
(6,544 Views)

Why Word?

 

it's useless.

 

Use HTML and CSS

 

Legit light years better bro, there is NOTHING you can do in Word that you can't in HTML.

0 Kudos
Message 10 of 11
(6,532 Views)