XLL+ Class Library

CXlMacros::WorkbookGetWorksheetNames

Returns a list of all the sheets in a workbook

[C++]
static int WorkbookGetWorksheetNames(
   std::vector<CString>& vecSheetNames,
   const char* name_text = 0,
   bool complete_names = false
);

Parameters

vecSheetNames

A reference to a collection of strings that will be cleared and populated with sheet names if the function succeeds.

name_text

Name_text is the name of an open workbook. If omitted, the active workbook is used.

complete_names

Complete_names is a boolean value that controls whether the returned names will be in complete form (i.e. book[sheet]), or in short form (sheet). If omitted, the short form will be used.

Return value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

This a helper function that calls GET.WORKBOOK(2) and extracts the resulting array into a vector of strings. around See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods