none
xlSheetId can't recongize the input sheet name RRS feed

  • Question

  • Hi guys,

    I am trying to get the sheetid using the C API() function xlSheetId. I have tried different ways for sheet name but it always returns the sheet id of the active sheet. Please help! Any idea is extremely welcome!

    Here is my code:

    LPXLOPER12

    nm = TempStr12(L"Sheet3");    // also tried the following names; 

                                                        //nm = TempStr12(L"[Example.xlsm]Sheet3");   

                                                        // nm = TempStr12(L"\022[Example.xlsm]Sheet3");   

    XLOPER12xSheet;

    Excel12(xlSheetId, &xSheet, 1, &nm);

    Excel12f(xlcAlert, 0, 1, TempInt12(xSheet.xltype));

    Excel12f(xlcAlert, 0, 1, TempInt12(xSheet.val.mref.idSheet));

    Thank you so much!


    • Edited by SJ YU Thursday, December 1, 2016 8:08 PM typo
    Thursday, December 1, 2016 8:06 PM