LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Import the excel sheet with its property

Solved!
Go to solution

Hii

 

 

My task is to import my excel sheet into my frontpanal control .... but with out opening the excel sheet i want to update in my Front panal...

 

Main thing is my excel sheet contains the cells with different colors in each cell... my task is to import that file as it is in my excel sheet to my labview front panel object...

 

can any 1 suggest me an idea how to implement this task........

0 Kudos
Message 1 of 6
(5,473 Views)

Well, since you have an Excel workbook, then you need to use ActiveX to read the Excel data as well as the colors of the cells. As for the display you can either use a table control/indicator (you can set the colors of cells via properties), or you can try to use the Microsoft Office Spreadsheet ActiveX control embedded in an ActiveX container. NOTE: This ActiveX control is NOT the same as Excel. It is a different beast. It looks like a spreadsheet, and has a few tools within it, but it's not the same. This means that if you decide to pursue this ActiveX control you would need to do the same thing as the table control: copy the data and write to the control, and set the background colors of the cells (which I don't know if you can do with the Spreadsheet control).

 

Either way, you will need to use ActiveX to read the Excel workbook data. There are tons of examples on this forum as well as on the Excel thread. Search, and you will find them.

Message Edited by smercurio_fc on 07-10-2009 09:51 AM
Message 2 of 6
(5,462 Views)

hiii sorry actually i can't understand .. if i use the Activex spreedsheet control for displaying the excel sheet means it will import the same as in my excel sheet i.e with same color as in my original sheet..,,

 

can u say how to implement this task..... 

0 Kudos
Message 3 of 6
(5,449 Views)
Solution
Accepted by topic author Karthikeyan_Mathiyalagan

The ActiveX Microsoft Office Spreadsheet Control will not import an Excel workbook. Whether you choose to use a LabVIEW table control or the ActiveX control you have to manually read the data from your Excel workbook using ActiveX (for Excel 2003 and earlier), and then populate the control (whether it's a LabVIEW table or the Spreadsheet ActiveX control). Then, using ActiveX calls again you have to scan through your Excel worksheet and read the background colors of the cells and then set the cells of the LabVIEW table control or the ActiveX control to be the same. This is done using the properties of the controls.

 

Bottom line: this is a very manual process. For example, the attached VI is one that I post quite often. It will read the data of an Excel worksheet and place it into a LabVIEW table control.

 

Another option is to simply use a web browser control and display the spreadsheet using the Excel browser plug-in, as explained in this KB article: Using the Microsoft Web Browser Control to Embed an Excel Spreadsheet in LabVIEW.

 

Question: why do you need to do this? What are you trying to accomplish in the long run? Perhaps there is a better way to do this. 

Message 4 of 6
(5,438 Views)

could you post same VI for Labview 8.0

 

thanks

0 Kudos
Message 5 of 6
(5,379 Views)
Message 6 of 6
(5,373 Views)