LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing Excel Sheet in LabVIEW

Solved!
Go to solution

I have a series of MS Excel 2007 files (xlsx) that I would like to embed and view in LabVIEW 2012 by selecting them individually. Currently the only way I can see the Excel sheet in LabVIEW is to place my ActiveX container on the front panel and then 'Select ActiveX Object' followed by 'Create Object from File'. The Excel sheet then fills the ActiveX container and that is exactly what I want my front panel to look like. However, I do not seem to be able to 'Create Object from File' programmatically using Nodes and have to manually link each file to display my result in the ActiveX container. I am sure I am missing something and any suggestion on how to acomplish this programmatically would be greatly appreciated - thanks in advance!

 

Original Excel file example

 

ExcelSheet.jpg

 

Inserting an ActiveX container and selecting 'Create Object From File'

 

ActiveXInsertObject.jpg

 

Desired result below!

 

LV-ActiveXContainer.jpg

 

 

 

 

 

 

Message 1 of 14
(6,298 Views)

Please post your VI of what you have attempted.

0 Kudos
Message 2 of 14
(6,277 Views)

 

The'Document' container can only be managed from the front panel by right clicking it and inserting an ActiveX object and then linking that object to the Excel file.  The container does not seem to be manageable programatically via nodes nor properties.  Hence the block diagram is stuck at the source of the ActiveX container's reference. 


@nyc_(is_out_of_here) wrote:

Please post your VI of what you have attempted.


 

 

 

 

 

0 Kudos
Message 3 of 14
(6,255 Views)

I'm working alongside OP on this. 

 

Below is some ActiveX code that successfully interacts with the Excel workbook (it returns the right Worksheet name), but it does not ever insert the Excel Workbook into the front panel ActiveX container, which is our goal.

 

Excel.png

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 4 of 14
(6,223 Views)

@elset191 wrote:

I'm working alongside OP on this. 

 

Below is some ActiveX code that successfully interacts with the Excel workbook (it returns the right Worksheet name), but it does not ever insert the Excel Workbook into the front panel ActiveX container, which is our goal.

 

Excel.png


I don't have Excel on this laptop, so I am unable to try out the VI.

 

See if http://forums.ni.com/t5/LabVIEW/Display-Excel-Worksheet-worksheet-itself-not-just-data-in/td-p/27863... is helpful.

 

 

Message 5 of 14
(6,207 Views)

nyc your link is broke thanks for the point in the right direction

 

See Here for exaple code to get'r'done Tim

"Should be" isn't "Is" -Jay
Message 6 of 14
(6,192 Views)

not sure why the cut and paste did not work

here is the correct URL    http://forums.ni.com/t5/LabVIEW/Display-Excel-Worksheet-worksheet-itself-not-just-data-in/td-p/27863...

 

 

0 Kudos
Message 7 of 14
(6,186 Views)

Jeff,

 

I tracked that link down from nyc's broken one.  That kept wanting to open the Excel file in Excel itself, rather than in the web browser window.  BUT, there was a note in the help for one of the subVIs that said this "Note: If the Excel Workbook opens in a new window instead of the Web browser window, change the view options for the file type. From the Windows Control Panel, double-click Folder Options and click the File Types tab.  Select the .xls file extension and click the Advanced button. Place a checkmark in the Browse in same window checkbox.?

 

In Windows 7, that option apparently doesn't exist, but it led me here, which told me to change the registry.  After doing so, the Excel file now opens in the embedded web browser. 

 

Thanks, gentlemen.

--
Tim Elsey
Certified LabVIEW Architect
Message 8 of 14
(6,169 Views)
Solution
Accepted by topic author MS@FSI

Outstanding team effort!

Thanks for closing the loop Tim.  Nugget that up, tag it  and make sure OP marks the solution-  It takes some work to track it down. 

"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 14
(6,164 Views)

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.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 10 of 14
(6,154 Views)