Help Contents

ExcelOptions Object

ExcelOptions object specifies additional Microsoft Excel processing options.

Remarks

ExcelOptions object specifies additional MS Excel processing options used when converting Excel documents. These options are used only if special document processing for Microsoft Excel is turned on with UseAutomation property of BatchProcessingOptions object.

Object access

You may retrieve an ExcelOptions object instance using ExcelOptions property of BatchProcessingOptions object:

Set ExcelOptions=P2H.DefaultBatchProcessingOptions.ExcelOptions 
Here P2H refers to Server object instance. Then you can access its properties and methods using a reference to the created object.

 

Properties
 

Name Type Description
OverridePrintQuality Boolean This property specifies whether to use printing resolution stored in Excel document sheets properties and shown in the Page Setup window (false) or to use the printing resolution specified with the Resolution property of PrintingPreferences object (true), i.e. if printing resolution of Excel sheets should be overridden with Print2HTML5 Printer resolution or not.
MS Excel is known to launch multiple print jobs when sheets of different resolutions are encountered. It may result in Print2HTML5 capturing only the first sheet range printed with the same resolution and skipping the other sheets. You may guarantee that such situation cannot happen if you set this property to true. However, in this case keep in mind that the sheet resolution stored in the Excel document is ignored. Also note that if this option is set to false, you cannot convert an entire workbook that has several sheets with different resolution.
SheetRange String This property specifies which workbook sheets should be converted to Print2HTML5 format. Sheets that do not fit the specified range are skipped at printing. The string should be in the following format:

[Range1Start[-][Range1End]] [,Range2Start[-][Range2End]] [, ... ]

This string is composed of a sequence of sheet ranges separated by commas. Each range can be either a plain sheet number such as "3", a sheet range such as "2-7" or an open sheet range such as "20-".
For example, string "1,3-5,8-" instructs to print sheet 1, sheets from 3 to 5, and sheets from sheet 8 till the last sheet. Sheet 2, 6 and 7 are skipped and not included in the output document.
Empty string value makes Print2HTML5 print all document sheets.
You cannot change the order of sheets contrary to the order of sheets in the Excel workbook. For example, if you specify "2,3,1", the document will still be printed in the natural order "1,2,3".
Similarly, you cannot print any sheet twice. For example, "1,1" will print the first sheet only once.

If you changed properties of this object and want to save the changes, use ApplyChanges method of the BatchProcessingOptions object which contains this ExcelOptions object instance.

Examples

The following example obtains an ExcelOptions object instance, changes its SheetRange property to allow printing only of the first three sheets and saves the changes:

Set BPOpt=P2H.DefaultBatchProcessingOptions
Set ExcelOptions=BPOpt.ExcelOptions 
ExcelOptions.SheetRange="1-3"
BPOpt.ApplyChanges
Here P2H refers to a Server object instance.