LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert a excel file into activeX container which the excel file store in access database by use OLE object datatype.

Hello everyone,

 

    I meet a problem need someone's help. 

    I am trying to get excel file from database(I use access and store the excel file by use OLE object datatype) and then show the choosed file into activex container for modify and then save back to database.I have no idea how to convert the variant data to activex data that can use on next steps by use "variant to data".vi

 

Hope some one may help me.

 

Thanks

 

Tim 

0 Kudos
Message 1 of 3
(3,454 Views)

What is ActiveX data?

 

When you use an Excel Container you get a reference and ther should be a method/property where you can write the tables contents, I think it's a string datatype what you need then. So just convert your table from the database into a 2D String array using the Variant to Data. You might need to use nested For-Loops then to write the date to the excel container as strings.

 

Just have a look at some examples for excel in LabVIEW.

 

 

Hope this helps,

Christian

0 Kudos
Message 2 of 3
(3,440 Views)

There are two separate issues here. The first is converting the data read from the database to an OLE object datatype. The second is to display it on the front panel.

 

As for the first: you are, for some unfathomable reason, storing an Excel file into a database. I have no idea why anybody would want to do this.  Regardless, assuming you're using the database toolkit, or something similar, you're going to get a variant. I don't know if this would even work, but you would need to wire an automation refnum to the Variant to Data function. The class would probably be Excel.Workbook.

 

As for the second: there is no Excel container. So, even if you get the data out of the database and into a workbook object, you'd have no place to put it. There is a Microsoft Spreadsheet Control, but that's not an Excel workbook. You would need to copy the data from the workbook object into the Spreadsheet Control using the ActiveX methods of both. Or, you could save the workbook to file, and use a browser ActiveX control, allowing you to leverage the Excel plug-in for browsers. 

0 Kudos
Message 3 of 3
(3,429 Views)