LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need a little help help with the Spreadsheet 9 ActiveX control

Here's the situation: I want to import data from an Excel file to the MS Office Spreadsheet 9.0 ActiveX control on the LV front page. I can retrieve the data just fine but I can't get it to display in the control on the front page. I can select a range and when I try to write to the Value property I find that I cannot. The problem seems to be the Value property itself cannot handle 2-D data arrays. I can select a 2D range and write a single value which gets written to every cell in the range but when I read the data I get only the first cell in the range and an error if I try to caste the Variant output to a 2D array.
 
I've noticed a Value2 property for the range when actually working with Excel but I haven't been able to determine where or if it exists for the Spreadsheet 9 control. I've attached a little test program to better show what I'm experiencing/talking about. Anyone have any suggestions on this? It seems like it would be possible or else why have the control there but I haven't found a way around it. Thanks in advance.
 
Gary D
0 Kudos
Message 1 of 3
(2,419 Views)

Hey Gary,

What version of MS Office does the 9.0 ActiveX control come with. I have version 11.0 here. I could get your program working on my computer but I had to reinitialize the activex control to the 11.0 control. I also had to reselect the properties. All the properties are essentially the same except Value. In this ActiveX version, I see the Value2 property (the Value property does not exist). And your method of reading and writing to the Value2 property handles 2D arrays.

If you can tell me what version of Office you are using, I will try to find a computer with that version and try your program.

Jack J.
Applications Engineer
National Instruments

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


@Jack J. wrote:

Hey Gary,

What version of MS Office does the 9.0 ActiveX control come with. I have version 11.0 here. I could get your program working on my computer but I had to reinitialize the activex control to the 11.0 control. I also had to reselect the properties. All the properties are essentially the same except Value. In this ActiveX version, I see the Value2 property (the Value property does not exist). And your method of reading and writing to the Value2 property handles 2D arrays.

If you can tell me what version of Office you are using, I will try to find a computer with that version and try your program.

Jack J.
Applications Engineer
National Instruments



Most of the computers have Office 2000 which uses the Value property and the Spreadsheet 9.0 control. I too have been able to duplicate it ona computer with Office 2000 (Spreadsheet 11.0). I think it may just be a functionality of the Excel version though for some reason if I use Excel and go through the song and dance with the methods and properties, I get to the Value2 property.
 
After writing that it seems weird that using Excel properties and methods gets me to the point where I can select the Value2 method and read/write accordigly, but with the Spreadsheet 9.0 control (which, I assume is simply embedding Excel in the app) I get to a different set of properties. Perhps Spreadsheet 10 (or 11) is on the computer but not showing up? That's the only sensible conclusion I can come to, though it seems weird for it to not show up on multiple computers which effectively kills that idea anyway.
 
Anyway. thanks for any help you can provide.
0 Kudos
Message 3 of 3
(2,398 Views)