IXlsWorkbook
COM interface ( getting help with interfaces )

 

interface IXlsWorkbook : IDispatch
{

  [id(1)         ] HRESULT AddWorksheet([in]BSTR name, [out, retval] IXlsWorksheet** worksheet);
  [id(2)         ] HRESULT Close();
  [id(3), propget] HRESULT WorksheetCount([out, retval] int* count);
  [id(4), propget] HRESULT WorksheetByIndex([in]int index, [out, retval] IXlsWorksheet** worksheet);
  [id(5), propget] HRESULT WorksheetByName([in]BSTR name, [out, retval] IXlsWorksheet** worksheet);
  [id(6), propget] HRESULT FactorizedStringsMode([out, retval] BOOL* bFactorizedStringsMode);
  [id(6), propput] HRESULT FactorizedStringsMode([in]BOOL bFactorizedStringsMode);
  [id(7), propget] HRESULT StyleOption([out, retval] enumStyleOption* styleOption);
  [id(7), propput] HRESULT StyleOption([in]enumStyleOption styleOption);
  [id(8), propget] HRESULT FormulaLanguage([out, retval] enumFormulaLanguage* language);
  [id(8), propput] HRESULT FormulaLanguage([in]enumFormulaLanguage language);
  [id(9)         ] HRESULT AddChart([in]BSTR name, [in]enumChartType type, [out, retval] IXlsChart** chart);
  [id(10),propput] HRESULT IgnoreErrorNumberAsText([in]BOOL bIgnoreError);
  [id(11),propget] HRESULT CalculationOptions([out, retval]IXlsCalculationOptions** options);
  [id(12)        ] HRESULT CalculateFormulas();
  [id(13),propget] HRESULT ExcelTargetVersion([out, retval] enumExcelTargetVersion* version);
  [id(13),propput] HRESULT ExcelTargetVersion([in]enumExcelTargetVersion version);
  [id(14),propget] HRESULT NamedRanges([out, retval]IXlsRanges** namedranges);
  [id(15),propget] HRESULT Properties([out, retval]IXlsWorkbookProperties** workbookproperties);
  [id(16),propget] HRESULT FactorizedFloatsMode([out, retval] BOOL* bFactorizedFloatsMode);
  [id(16),propput] HRESULT FactorizedFloatsMode([in]BOOL bFactorizedFloatsMode);
  [id(17)        ] HRESULT FixExcelLocale();
  [id(18),propget] HRESULT EnforceDataValidation([out, retval] BOOL* bEnable);
  [id(18),propput] HRESULT EnforceDataValidation([in]BOOL bEnable);
  [id(19),propget] HRESULT AutoAdjustDefinedNames([out, retval] BOOL* bAutoAdjustDefinedNames);
  [id(19),propput] HRESULT AutoAdjustDefinedNames([in]BOOL bAutoAdjustDefinedNames);
  [id(20),propget] HRESULT Arabic([out, retval] BOOL* bArabic);
  [id(20),propput] HRESULT Arabic([in]BOOL bArabic);
  [id(21),propget] HRESULT AutoOpenExternalWorkbookReference([out, retval] BOOL* bExternalWorkbook);
  [id(21),propput] HRESULT AutoOpenExternalWorkbookReference([in]BOOL bExternalWorkbook);
  [id(22)        ] HRESULT Search([out, retval] IXlsSearch** search);
  [id(23)        ] HRESULT DeleteMacros();
  [id(24),propput] HRESULT Commit([in]BOOL bCommit);
  [id(25)        ] HRESULT EvalAsString([in]BSTR formula, [out, retval]BSTR* result);
  [id(26)        ] HRESULT EvalAsFloat([in]BSTR formula, [out, retval]double* result);
  [id(27),propget] HRESULT DisplaySheetTabs([out, retval] BOOL* bSheetTabs);
  [id(27),propput] HRESULT DisplaySheetTabs([in]BOOL bSheetTabs);
  [id(28),propget] HRESULT DisplayRowHeadings([out, retval] BOOL* bRowHeadings);
  [id(28),propput] HRESULT DisplayRowHeadings([in]BOOL bRowHeadings);

}

 

HRESULT AddWorksheet([in]BSTR name, [out, retval] IXlsWorksheet** worksheet);
creates a new worksheet with the name passed in parameter. The following characters are forbidden : / \\ : * [ ], and the name must be less than 32 characters long. See IXlsWorksheet for more information.

HRESULT Close();
closes the workbook, closes the .xls file and makes it ready to use.

HRESULT WorksheetCount([out, retval] int* count);
returns the number of worksheets in the current workbook.

HRESULT WorksheetByIndex([in]int index, [out, retval] IXlsWorksheet** worksheet);
returns the i-th worksheet. Since this property can fail, make sure to check the returned worksheet for validity.

HRESULT WorksheetByName([in]BSTR name, [out, retval] IXlsWorksheet** worksheet);
returns the worksheet whose name matches the one passed as first parameter. Since this property can fail, make sure to check the returned worksheet for validity.

HRESULT FactorizedStringsMode([out, retval] BOOL* bFactorizedStringsMode);
returns the string factorizing mode, i.e. true if the xlsgen avoids storing any string duplicates, false otherwise. Default value is false.

HRESULT FactorizedStringsMode([in]BOOL bFactorizedStringsMode);
sets the factorizing mode. If true, xlsgen avoids storing any string duplicates. The factorizing mode can be changed in the middle of the code.

HRESULT StyleOption([out, retval] enumStyleOption* styleOption);
returns whether styles should be preserved/combined when cells from a template are overwritten with new content. Default is user-defined. See the enumStyleOption enumerated type.

HRESULT StyleOption([in]enumStyleOption styleOption);
sets whether styles should be preserved/combined when cells from a template are overwritten with new content. See the enumStyleOption enumerated type.

HRESULT FormulaLanguage([out, retval] enumFormulaLanguage* language);
returns the formula language. Default is English. See the enumFormulaLanguage enumerated type.

HRESULT FormulaLanguage([in]enumFormulaLanguage language);
sets the formula language. See the enumFormulaLanguage enumerated type.

HRESULT AddChart([in]BSTR name, [in]enumChartType type, [out, retval] IXlsChart** chart);
creates a worksheet of type chart, i.e. with only a chart in it. Alternatively, you can use worksheet.NewChart() in order to embed a regular chart somewhere in the grid of a worksheet.

HRESULT IgnoreErrorNumberAsText([in]BOOL bIgnoreError);
sets whether Excel should ignore errors whenever numbers are stored as text, otherwise showing a green triangle in the corner of cells. Does not have effect with workbooks open using Excel versions prior Excel XP.

HRESULT CalculationOptions([out, retval]IXlsCalculationOptions** options);
retrieves the calculation options.

HRESULT CalculateFormulas;
calculates all formulas in the workbook (i.e. all worksheets).

HRESULT ExcelTargetVersion([out, retval] enumExcelTargetVersion* version);
returns the version of Excel to target.

HRESULT ExcelTargetVersion([in]enumExcelTargetVersion version);
sets the version of Excel to target. Optional. Default is Excel 2000.

HRESULT NamedRanges([out, retval]IXlsRanges** namedranges);
retrieves the range collection.

HRESULT Properties([out, retval]IXlsWorkbookProperties** workbookproperties);
returns the workbook properties object.

HRESULT FactorizedFloatsMode([out, retval] BOOL* bFactorizedFloatsMode);
returns the floats factorizing mode, i.e. if true, the xlsgen factorizes simple-precision floats as much as it can. Default value is false.

HRESULT FactorizedFloatsMode([in]BOOL bFactorizedFloatsMode);
sets the floats factorizing mode. If true, the xlsgen factorizes simple-precision floats as much as it can.

HRESULT FixExcelLocale();
fixes the Excel locale, removes the prompt raised when opening an Excel file (duplicate named area). This problem may arise when the user opens an Excel file created with an Excel version in another language (French versus English for instance).
The Excel locale prompt

HRESULT EnforceDataValidation([out, retval] BOOL* bEnable);
returns whether data validation should be enforced when adding data to the spreadsheet. Default value is false.

HRESULT EnforceDataValidation([in]BOOL bEnable);
sets whether data validation should be enforced when adding data to the spreadsheet. Default value is false.

HRESULT AutoAdjustDefinedNames([out, retval] BOOL* bAutoAdjustDefinedNames);
returns whether the defined names should auto-adjust themselves to the data being added to the spreadsheet. Default is : no. A common scenario is to auto adjust defined names when populating a list of rows.

HRESULT AutoAdjustDefinedNames([in]BOOL bAutoAdjustDefinedNames);
sets whether the defined names should auto-adjust themselves to the data being added to the spreadsheet. Default is : no. A common scenario is to auto adjust defined names when populating a list of rows.

HRESULT Arabic([out, retval] BOOL* bArabic);
returns whether the workbook displays the Arabic user interface (worksheets right-to-left, ...).

HRESULT Arabic([in]BOOL bArabic);
sets whether the workbook displays the Arabic user interface (worksheets right-to-left, ...).

HRESULT AutoOpenExternalWorkbookReference([out, retval] BOOL* bExternalWorkbook);
returns whether the workbook allows the automatic opening of external workbook references whenever formulas reference it. Default is : true

HRESULT AutoOpenExternalWorkbookReference([in]BOOL bExternalWorkbook);
sets whether the workbook allows the automatic opening of external workbook references whenever formulas reference it. Default is : true

HRESULT Search([out, retval] IXlsSearch** search);
performs an accurate keyword search into an existing Excel workbook (support for Excel 97, 2000, XP, 2003 and 2007 workbooks).

HRESULT DeleteMacros();
deletes VBA macros present in the file.

HRESULT Commit([in]BOOL bCommit);
sets whether the changes should be committed into the output file. Default is : true.

HRESULT EvalAsString([in]BSTR formula, [out, retval]BSTR* result);
evaluates the formula, returns a string. Returns #VALUE! if the formula cannot be evaluated.

HRESULT EvalAsFloat([in]BSTR formula, [out, retval]double* result);
evaluates the formula, returns a float. Returns 0 if the formula cannot be evaluated.

HRESULT DisplaySheetTabs([out, retval] BOOL* bSheetTabs);
returns whether the workbook displays the sheet tabs or not. Default is true.

HRESULT DisplaySheetTabs([in]BOOL bSheetTabs);
sets whether the workbook displays the sheet tabs or not. Default is true.

HRESULT DisplayRowHeadings([out, retval] BOOL* bRowHeadings);
returns whether the workbook displays row headings in sheets. Default is true.

HRESULT DisplayRowHeadings([in]BOOL bRowHeadings);
sets whether the workbook displays row headings in sheets. Default is true.