Construct a worksheet object and attach to named worksheet window
Construct a worksheet object and attach to the given layer
Worksheet( LPCTSTR lpcszWksName )
Worksheet( Layer & layer )
EX1
// Determine if there is a worksheet named Sheet1 in Book1 int Worksheet_Worksheet_Ex2(string strSheetName = "[Book1]Sheet1") { Worksheet wks(strSheetName); if(!wks) { out_str("There is no such worksheet"); return 1; } else out_str("Found worksheet " + strSheetName); return 0; }
EX2
// Report the number of columns in the active worksheet int Worksheet_Worksheet_Ex3() { Worksheet wks(Project.ActiveLayer()); if(!wks) { out_str("The active layer is not a worksheet, or there is nothing in the project"); return 1; } else { printf("Worksheet %s has %d columns\n",wks.GetPage().GetName(),wks.GetNumCols()); return 0; } }
Worksheet is one of the wrapper objects that is a reference to the actual internal Origin object.
You can construct a new Worksheet object from another layer object. The worksheet will become invalid if
the layer to construct with is actually not a worksheet
origin.h