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);
  [id(29),propget] HRESULT ShowZeros([out, retval] BOOL* bShowZeros);
  [id(29),propput] HRESULT ShowZeros([in]BOOL bShowZeros);
  [id(30),propget] HRESULT IsUsing1904Dates([out, retval] BOOL* b1904Dates);
  [id(31),propget] HRESULT GridA1Mode([out, retval] BOOL* bMode);
  [id(31),propput] HRESULT GridA1Mode([in]BOOL bMode);
  [id(32),propget] HRESULT TreatFloatsAsStrings([out, retval] BOOL* bStrings);
  [id(32),propput] HRESULT TreatFloatsAsStrings([in]BOOL bStrings);
  [id(33),propget] HRESULT VBAMacros([out, retval]BSTR* macros);
  [id(34),propget] HRESULT VBAModules([out, retval]IXlsVBAModules** modules);
  [id(35),propput] HRESULT EncryptionPassword([in]BSTR encryptionpassword);
  [id(36),propget] HRESULT Filepath([out, retval]BSTR* filepath);
  [id(37),propget] HRESULT VBAWorkbookName([out, retval]BSTR* workbookName);
  [id(38),propget] HRESULT Theme([out, retval] enumWorkbookTheme* theme);
  [id(38),propput] HRESULT Theme([in]enumWorkbookTheme theme);
  [id(39)        ] HRESULT PrintWith([in]BSTR printerName, [in]BSTR optionalVirtualPrinterFilename);
  [id(40),propget] HRESULT ChartEngine([out, retval] enumChartEngine* engine);
  [id(40),propput] HRESULT ChartEngine([in]enumChartEngine engine);
  [id(41),propget] HRESULT PDFEngine([out, retval] enumPDFEngine* engine);
  [id(41),propput] HRESULT PDFEngine([in]enumPDFEngine engine);
  [id(42),propget] HRESULT ThemeManager([out, retval] IXlsTheme** themeManager);
  [id(43),propget] HRESULT ExternalReferences([out, retval]IXlsExternalReferences** extreferences);
  [id(44),propput] HRESULT InsertFillOption([in]BOOL bFill);
  [id(45),propget] HRESULT AntiAliasing([out, retval] enumAntiAliasing* setting);
  [id(45),propput] HRESULT AntiAliasing([in]enumAntiAliasing setting);
  [id(46),propget] HRESULT MaxRows([out, retval] int* maxrows);
  [id(47),propget] HRESULT MaxColumns([out, retval] int* maxcolumns);
  [id(48),propget] HRESULT FuzzyStringMatch([out, retval] enumStringMatch* nFuzzyStringMatch);
  [id(48),propput] HRESULT FuzzyStringMatch([in]enumStringMatch nFuzzyStringMatch);
  [id(49),propget] HRESULT R_Programming([out, retval]IXlsRProgramming** rprogramming);
  [id(50),propget] HRESULT ActiveWorksheet([out, retval] IXlsWorksheet** worksheet);
  [id(51)        ] HRESULT TryParseFormula([in]BSTR formula, [out, retval]enumParseFormulaError* error);
  [id(52),propget] HRESULT FormulaDefinitionUpdate([out, retval] BOOL* bUpdate);
  [id(52),propput] HRESULT FormulaDefinitionUpdate([in]BOOL bUpdate);
  [id(53),propget] HRESULT DynamicArray([out, retval] BOOL* bEnable);
  [id(53),propput] HRESULT DynamicArray([in]BOOL bEnable);

}

 

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.

HRESULT ShowZeros([out, retval] BOOL* bShowZeros);
returns whether the workbook displays zeros in sheets. Default is true.

HRESULT ShowZeros([in]BOOL bShowZeros);
sets whether the workbook displays zeros in sheets. Default is true.

HRESULT IsUsing1904Dates([out, retval] BOOL* b1904Dates);
returns whether the file uses the 1904 date system where stored dates are offset by 4 years and one day.

HRESULT GridA1Mode([out, retval] BOOL* bMode);
returns whether the workbook displays the grid in A1 mode or numeric mode. Default is : true (A1)..

HRESULT GridA1Mode([in]BOOL bMode);
sets whether the workbook displays the grid in A1 mode or numeric mode. Default is : true (A1).

HRESULT TreatFloatsAsStrings([out, retval] BOOL* bStrings);
returns whether cell types are return as strings when they are floats stored as strings. Default is : NO (cell type is float).

HRESULT TreatFloatsAsStrings([in]BOOL bStrings);
sets cell types are return as strings when they are floats stored as strings. Default is : NO (cell type is float).

HRESULT VBAMacros([out, retval]BSTR* macros);
returns the VBA macros in plain text.

HRESULT VBAModules([out, retval]IXlsVBAModules** modules);
returns the VBA modules.

HRESULT EncryptionPassword([in]BSTR encryptionpassword);
encrypts the file using the passed password. Applies to XLS and XLSX files. The password may have at most 15 characters for XLS files and 255 characters for XLSX files.

HRESULT Filepath([out, retval]BSTR* filepath);
returns the filepath of the opened file.

HRESULT VBAWorkbookName([out, retval]BSTR* workbookName);
returns the corresponding VBA workbook name for storing/editing/running macros.

HRESULT Theme([out, retval] enumWorkbookTheme* theme);
returns the theme used in workbook for all new objects (charts, ...).

HRESULT Theme([in]enumWorkbookTheme theme);
sets the theme used in workbook for all new objects (charts, ...).

HRESULTPrintWith([in]BSTR printerName, [in]BSTR optionalVirtualPrinterFilename);
prints all visible worksheets in a single print job. The first parameter passed is the printer name and is mandatory. The second parameter is optional and is useful for virtual printers, such as a PDF printer (you can pass an empty string).

HRESULT ChartEngine([out, retval] enumChartEngine* engine);
returns the chart engine used for rendering charts in print, preview, PDF, ... scenarios. Default is : scalable.

HRESULT ChartEngine([in]enumChartEngine engine);
sets the chart engine used for rendering charts in print, preview, PDF, ... scenarios. Default is : scalable.

HRESULT PDFEngine([out, retval] enumPDFEngine* engine);
returns the pdf engine used for PDF generation scenarios. Default is : text-based.

HRESULT PDFEngine([in]enumPDFEngine engine);
sets the pdf engine used for PDF generation scenarios. Default is : text-based.

HRESULT ThemeManager([out, retval] IXlsTheme** themeManager);
returns the theme manager.

HRESULT ExternalReferences([out, retval]IXlsExternalReferences** extreferences);
retrieves the collection of external references.

HRESULT InsertFillOption([in]BOOL bFill);
sets whether the insert row or col feature fills new blanks or not. Default is : true.

HRESULT AntiAliasing([out, retval] enumAntiAliasing* setting);
returns the chart anti-aliasing setting used for rendering. Default is : anti-aliasing level 1.

HRESULT AntiAliasing([in]enumAntiAliasing setting);
sets the chart anti-aliasing setting used for rendering. Default is : anti-aliasing level 1.

HRESULT MaxRows([out, retval] int* maxrows);
returns the maximum number of rows in each sheet of the workbook.

HRESULT MaxColumns([out, retval] int* maxcolumns);
returns the maximum number of columns in each sheet of the workbook.

HRESULT FuzzyStringMatch([out, retval] enumStringMatch* nFuzzyStringMatch);
returns whether string matching is fuzzy or strict. Default value : strict.

HRESULT FuzzyStringMatch([in]enumStringMatch nFuzzyStringMatch);
sets whether string matching is fuzzy or strict. Default value : strict.

HRESULT R_Programming([out, retval]IXlsRProgramming** rprogramming);
retrieves the R programming language interface.

HRESULT ActiveWorksheet([out, retval] IXlsWorksheet** worksheet);
returns the active (selected) worksheet.

HRESULT TryParseFormula([in]BSTR formula, [out, retval]enumParseFormulaError* error);
tries to parse the formula, returns 0 if there is no error or a parsing error (impaired parenthesis, etc).

HRESULT FormulaDefinitionUpdate([out, retval] BOOL* bUpdate);
returns whether or not the definition of formulas in the workbook are translated when rows or columns are inserted or deleted. Default is : True.

HRESULT FormulaDefinitionUpdate([in]BOOL bUpdate);
sets whether or not the definition of formulas in the workbook are translated when rows or columns are inserted or deleted. Default is : True.

HRESULT DynamicArray([out, retval] BOOL* bEnable);
returns whether or not dynamic arrays are enabled, which means they are allowed to be created in sheets. Default value is true.

HRESULT DynamicArray([in]BOOL bEnable);
sets whether or not dynamic arrays are enabled, which means they are allowed to be created in sheets. Default value is true.