09-24-2014 10:07 AM
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
Inserting an ActiveX container and selecting 'Create Object From File'
Desired result below!
Solved! Go to Solution.
09-24-2014 10:43 AM
Please post your VI of what you have attempted.
09-24-2014 11:14 AM - edited 09-24-2014 11:25 AM
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.
09-24-2014 01:04 PM
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.
09-24-2014 02:09 PM
@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.
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.
09-24-2014 02:47 PM
nyc your link is broke thanks for the point in the right direction
See Here for exaple code to get'r'done Tim
09-24-2014 02:54 PM
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...
09-24-2014 03:35 PM
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.
09-24-2014 03:42 PM
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.
09-24-2014 03:51 PM
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.