LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using Excel_RangeGetItem() and Excel_RangeSetItem() in CVI 6.0

I borrowed the usages of these two functions from Excel200dem.prj. But the cell range indexing is acting weirdly. If I want to access to cell range A1-A700, A2-701, A3-A702, and A4-A703, I'm actually accessing to ranges A1-A700, A3-A702, A5-A704, and A7-A706 respectively.
You may suggest me to use Safe Array. I'm now using it to write the data, but when I try to read, it seems to only support 2-dimension reading (there is a function CA_Get2DArrayElement(), but no function like CA_Get1DArrayElement() ).
Pls somebody can help either of the problems. Thank you very much.

Jason
0 Kudos
Message 1 of 2
(3,565 Views)
Hi,
I've attached two files that contain passages of my program that deal with reading and writing data in Excel.
Concerning your "2Darray-problem" there is a trick: just create a 2D array with 2nd dimension=1, so that it is in fact a 1D array but can be handled as a 2D so that you can use the provided functions in a normal way.
Remark: I'm using ExcelXP (Object Library 10.0) while the CVI samples have been programmed under Excel2000 (Object Library 9.0). So some functions may look different.
Download All
Message 2 of 2
(3,565 Views)