Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure ToTiff(p_Printer: PrinterDriver; p_InputFile, p_OutputFile: String);
- var ExcelApp: ExcelApplication;
- var Workbook: ExcelWorkbook;
- var Worksheet: ExcelWorksheet;
- var ReadOnly: OleVariant;
- var Missing: OleVariant;
- var LocaleID: Integer;
- var SaveChanges: OleVariant;
- begin
- // Create a Excel's Application object
- ExcelApp := CoExcelApplication.Create;
- ReadOnly := True;
- Missing := Variants.EmptyParam;
- // Set en-US locale or call GetThreadLocale
- LocaleID := $0409;
- Workbook := ExcelApp.Workbooks.Open(p_InputFile, 2, ReadOnly, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, LocaleID);
- // Loop through each worksheet
- for Worksheet in Workbook.Worksheets do
- begin
- Writeln(' - Processing worksheet ', Worksheet.Index, ' (', Worksheet.Name, ')');
- end;
- // Close the workbook and exit excel
- SaveChanges := False;
- Workbook.Close(SaveChanges, Missing, Missing, LocaleID);
- ExcelApp.Quit;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement