LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX Excel

I've created an excel speadsheet to hold data collected by a Keithley meter using the examples contained in the demo file "excel2000demo". So far so good. My problem is that each time the meter sends data to Excel,  the data  repeats itself for the entire range, not one row at a time. How can I change the following code to accomplish this.
 
I've try adjusting the variable ROWS to 1 but no luck - the same data occupies all 250 rows. Any suggestions?
 
#define EXCEL_TEST_RANGE "A1:CD250"
 
error = CA_VariantSetCString (&MyCellRangeV, EXCEL_TEST_RANGE]); 
error = Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyCellRangeV,CA_DEFAULT_VAL,
                         &ExcelRangeHandle);
 
 for (i=0;i<ROWS;i++)        
 { 
 for (j=0; j < COLUMNS; j++){
       error = CA_VariantSetCString (&vArray[i*COLUMNS+j], my_data[j]); 
    if (error<0) goto Error;
  }  
 
 
0 Kudos
Message 1 of 2
(3,281 Views)
You'll need to change the EXCEL_ARRAY_OF_CELLS to a single row as well. In the example if you change it to "A2:H2" and ROWS to 1 it will insert the data to a single row.
Test Engineer - CTA
0 Kudos
Message 2 of 2
(3,254 Views)