LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open an Excel template in LAbVIEW


DanNatCorning wrote:

Guys, I really appreciate all your help and assistance. What I really want to be able to do is to open an instance of Excel right on the front panel (see attached below), as opposed to opening Excel is a separate window.  I really like the appearance and functionality that I get with an ActiveX container with a Microsoft Office Spreadsheet 11.0 inserted.   I just want to be able to open a specific file (template) within that ActiveX container. This way, the user never leaves LabVIEW.  IS there a straightforward way to accomplish this? Does this make sense? 


As smercurio pointed out, the Office Spreadsheet that you're embedding on your front panel isn't the same as the Excel application that your coworker's VI opens (from the beginning of the thread), and the Office Spreadsheet doesn't support the Excel Application properties and methods you're trying to use (although it does support similar properties and methods for workbooks and worksheets).  Have you looked at the MSDN (Microsoft Developer Network) documentation for the Office Web Components (one of which is the spreadsheet)?  It's really nothing to do with LabVIEW that you can't get this to work the way you expect, it's the limits of the ActiveX components that Microsoft provides.

0 Kudos
Message 11 of 15
(1,336 Views)
Smercurio, I tried the Web Browser approach, but this opens Excel in a seperate window, as opposed to opening it in the container displayed on the VI front panel...am I doing something wrong?
0 Kudos
Message 12 of 15
(1,326 Views)

You may not have the system configured to view Excel files in the browser. What happens when you open an Excel workbook from within the browser?

 

Or, you're using Office 2007. Office 2007 changed the default behavior so that documents are opened in the application window rather than the browser window. If that's the case you can change the default behavior as described here.

Message Edited by smercurio_fc on 05-15-2009 02:26 PM
0 Kudos
Message 13 of 15
(1,321 Views)
When I run the vi, I am prompted to choose whether to open or save the file. (See capture) When I click open, it opens in a seperate window. (Office 2003)
0 Kudos
Message 14 of 15
(1,317 Views)

That's normal behavior since the web browser is generating that dialog box. The same thing would happen if you were to try it from Internet Explorer. If you uncheck the box then you won't get the dialog next time. As far as it opening as a separate window, again, that's an operating system configuration. Check the internet, as this is a common problem.

 

You can use the Office Spreadsheet control, but it's your responsibility to populate the control's cells with the data from the Excel workbook. See attached for a simple example. The Read Excel VI is a VI that I had posted in a thread some time ago.

Download All
Message 15 of 15
(1,307 Views)