12.07.2015 Views

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Access<strong>in</strong>g <strong>Excel</strong> Functionality Us<strong>in</strong>g the C API 227The follow<strong>in</strong>g code is equivalent to the above, but uses the cpp_xloper class.xloper * __stdcall get_workbook(<strong>in</strong>t arg_num, char *book_name){cpp_xloper Arg1(arg_num, 1, 38);if(!Arg1.IsType(xltypeInt))return p_xlErrValue;}cpp_xloper Arg2(book_name);cpp_xloper RetVal;<strong>Excel</strong>4(xlfGetWorkbook, &RetVal, 2, &Arg1, &Arg2);return RetVal.ExtractXloper(true);8.9.11 Information about the workspace: xlfGetWorkspaceOverview:Enumeration value:Callable from:Return type:Arguments:The function returns <strong>in</strong>formation about the workspace.The argument corresponds to the <strong>in</strong>formation you are try<strong>in</strong>g toget. The mean<strong>in</strong>g of the most useful of these 72 values isgiven <strong>in</strong> Table 8.17. 6186 (xba)Commands and macro sheet functions.Various, depend<strong>in</strong>g on the value of the first argument.ArgNum: A number from 1 to 72 <strong>in</strong>clusive.Table 8.17 Selected argument to xlfGetWorkspaceArgNumWhat the function returns1 The current environment and version number, e.g., W<strong>in</strong>dows (32-bit) NT 5.00.2 The <strong>Excel</strong> version number as a str<strong>in</strong>g.3 If fixed decimals are set, returns the number of decimals, otherwise 0.4 True if <strong>in</strong> R1C1 mode.5 True if scroll bars are displayed.See also xlfGetW<strong>in</strong>dow with ArgNum = 26 and 27.6 True if the status bar is displayed.7 True if the formula bar is displayed.(cont<strong>in</strong>ued overleaf )6 For values not covered, see the Macro Sheet Function Help <strong>in</strong>cluded with the <strong>Excel</strong> SDK.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!