LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a handle to a worksheet in MS Excel 11.0 Object Library?

I was previously using the MS Excel 9.0 Object Library and had a function call:
 
 Excel_SheetsItem (ActiveSheetsHandle, NULL, CA_VariantInt(1), &DesiredWorksheetHandle);
 
which would return the handle to a specific worksheet from the active worksheets as specified by the 3rd parameter.  This function no longer exists in MS Excel 11.0 Object Library (along with many others).  The VB help file tells me I must index into the worksheets collection of the workbook object to obtain an object handle for the worksheet.  How do I do that?
 
Seems to me it's time for some new CVI examples code using the new object library.
 
Thanks,
 
Nick
 
 
0 Kudos
Message 1 of 2
(2,650 Views)
Hello Nick,

You can use the following function if you are using the Excel 11.0 Object Library:
Excel_SheetsGetItem (ActiveSheetsHandle, NULL, CA_VariantInt(index), &DesiredWorksheetHandle);

Hope this helps and good luck!
Shakhina P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,616 Views)