LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I know the active cell of an excel worksheet?

0 Kudos
Message 1 of 6
(3,796 Views)
Sorry, but the body of original post has not appeared... I need to know what is the active cell of a worksheet I opened with activeX function. For example, I start Excel with "ExcelRpt_ApplicationNew", then I open a workbook with "ExcelRpt_WorkbookOpen". Now the user of my application wants to select a cell anywhere in the workbook (or to do nothing, hence to leave the active cell the R1C1 cell of the sheet 1) and start from there to save data I serially read from an external device. I tried to catch the active sheet with the function "Excel_ActiveWorksheet (NULL, 0, LOCALE_NEUTRAL, 0, &sheet)", but it doesn't seems to work properly (I have always 0 as returned value of sheet). And then, when I will know the active sheet, how can I could know the active cell? Thanks a lot. Regards Andrea
0 Kudos
Message 2 of 6
(3,786 Views)

you can find examples on using Excel with CVI in the ...cvi\Samples\ActiveX\Excel folder on your machine.

Look at the Excel2000dem.prj, it does something similar to what you describe below.


AlessioD

0 Kudos
Message 3 of 6
(3,768 Views)

I was looking at the Example CVI has given.

Still not sure how to get the active cell address.

 

Does anyone know how ?

 

I need to figure this out asap.

Help share your knowlegde
0 Kudos
Message 4 of 6
(3,160 Views)

The Excel Report library does not support this functionality. To get this low level of support, you will need to use the Microsoft Excel Object Library instead. Use the Excel_GetProperty function with the Excel_AppActiveCell constant for the Property ID parameter. This will return a range object. The Excell2000dem.cws example is a good place to start.

National Instruments
0 Kudos
Message 5 of 6
(3,150 Views)

This is what i was looking for.

Thanks

 

Help share your knowlegde
0 Kudos
Message 6 of 6
(3,143 Views)