LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access excel using activeX object in LabVIEW

Solved!
Go to solution

Hello,

govindsankar_0-1713180466432.png

I have an application that opens an excel file by using Automation open from the ActiveX palette. It used to work and I havent opened this program in a long time and suddenly today it is not working. When I run it is giving an error element not found in this VI. What is happening? Thank you. 

 

0 Kudos
Message 1 of 18
(443 Views)

Hi govindsankar,

 


@govindsankar wrote:

It used to work and I havent opened this program in a long time and suddenly today it is not working. When I run it is giving an error element not found in this VI. What is happening?


Any (MSOffice) updates in the last time?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(434 Views)

no, not really. 

 
0 Kudos
Message 3 of 18
(430 Views)

You may need to "re-select" some or all of the ActiveX items.

 

Start with the first one, the "Excel application reference" that is wired into the "Open" node.  Delete it and re-create it.  If you can't find it, then Excel isn't properly installed and you probably need to repair your install or reinstall it.  After doing so your program should either work, or at the very least error out at a different location.

 

If that worked with no problem, then go to any node after that which produces an error, click it, then find the name on the list that is the exact same as its current name, and re-select it.  You will probably find that after "re-selection" that the inputs and/or outputs have changed.  Depending on the change(s), you may need to add new code to your program to handle them.

0 Kudos
Message 4 of 18
(369 Views)

I did already deleted the excel reference and recreated it and still cant work. BTW this problem is only in my PC. I created an application out of this program and ran the application in a different PC and there it works fine, in my PC both the application and the labview program doesnt work. I was thinking of re installing excel. But the thing is excel is working fine in my PC. I even used excel today morning. I dont know what change might have happened to excel for this program to work like this because this program used to work. I wrote this program in this PC 6 months ago and it worked then. Dont know what happened now. 

0 Kudos
Message 5 of 18
(337 Views)

ActiveX works through the registry for finding and instantiating the correct Automation Server DLL. Most likely your Excel registration got funky or corrupted. The application itself will still work but ActiveX Invocation fails. Do try a Repair Install of your Excel and/or Office package.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 18
(333 Views)

So finally I was able to re-install Excel but still it is not working. I dont have any other idea

0 Kudos
Message 7 of 18
(236 Views)

I had some similar thing happen and needed to reselect the Class in the Create node and then it relinked and broke my code since some functions had changed their calls. After fixing this it worked.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 18
(232 Views)

I dont understand. Can you elaborate. What I use is Automation Open, to which I wire the Excel Reference. So I am not sure what you mean. 

0 Kudos
Message 9 of 18
(229 Views)

I'm not sure if this is your problem but it fixed my Excel VIs that did work but didn't when I tried to run them on a new PC.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KZNSA2&l=en-US

 

0 Kudos
Message 10 of 18
(205 Views)