From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing Excel Sheet in LabVIEW

Solved!
Go to solution

just a guess here Tim  the method that loads that document into the ActiveX object is probably not performing to a point working and ni will not release it or there is a problem with the active x object self

 

okay Google speak still got a little bit of work to do


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 14
(1,676 Views)

@elset191 wrote:

Are either of you well versed enough to know why we can't just display the Excel worksheets in the Document container?  You can do it in Edit mode as Michael shows in the original post.  It stands to reason you ought to be able to do this with some code.

 

I think this solution will work fine for us, but there's always something unsettling about not knowing why something fails.


The answer by smercurio_fc in the following thread should answer you question http://forums.ni.com/t5/LabVIEW/Labview-2010-activex-container-Excel-2007/td-p/1230155

It boils down to ActiveX control versus ActiveX interface.

 

 

Message 12 of 14
(1,643 Views)

Kudos for your superior site searching abilities. 

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 13 of 14
(1,640 Views)

I realize that this is an old thread, but after not liking the solution presented here, I decided to reattempt this using LabVIEW 2015 and MS Office 2013 using the Microsoft Excel 15.0 Object Library Version 1.8 ActiveX Automation Objects.

 

I followed the same paradigm as the OP when creating the ActiveX Control. What I found, is that an ActiveX Container created from an Existing document cannot be interacted with. Same result as OP. However, when LabVIEW loads the control into memory, Excel is opened along with the Excel file that the control is linked to. Using this knowledge, I was able to programmatically get a reference to Excel. From the Application reference I was able to get the open workbook reference and modify the worksheet data and graph as expected.

 

Please download the Example VI and Excel Workbook. I have them saved in C:\Projects. I'm not sure how the file is linked but it would be best to start with the files there.

 

Please note, that you cannot save the workbook modified in memory to disk, it will create a file when saved, but I have been unsuccessful in reopening the file.

  

Open the VI and run the example and you should (crossing fingers) see the graph become populated with random data.

 

Brian G. Shea
Certified LabVIEW Architect
Download All
0 Kudos
Message 14 of 14
(1,003 Views)