Using arguments to invoke an excel method from PL/SQL with Oracle COM
Hello Gentlemen,
I has been trying to export an excel sheet to a PDF file format using “ExportAsFixedFormat” method, with no success or error message.
Moreover, I tried to use “PrintOut” method, if I use it with no parameters/arguments it executed without errors and display the sheet to an application installed in my PC (“SnagIt”), if I try to use it with an argument to assign a printer for it, I got this error message “PrintOut method of Workbook class failed xlmain11.chm”.
I believe I have a problem with using arguments, and I don’t know how to use it in a proper way; the code I used is listed below for your review and your kind help, thank you a lot, and I appreciate so much your helpful feedback.
Best regards,
Nabil
List 01 – using “ExportAsFixedFormat” method
==============================
ORDCOM.InitArg();
ORDCOM.SetArg('xlTypePDF','XlFixedFormatType');
ORDCOM.SetArg('E:\ TestDelete.pdf','BSTR');
ORDCOM.SetArg('xlQualityStandard','BSTR');
ORDCOM.SetArg('True','BOOL');
ORDCOM.SetArg('False','BOOL');
ORDCOM.SetArg('True','BOOL');
dbms_output.put_line('WorkSheetToken................WorkBookToken........'||WorkBookToken);
i := ORDCOM.Invoke(WorkBookToken, 'ExportAsFixedFormat', 6, DummyToken);
List 02 – using “PrintOut” method:
======================
ActivePrinter := 'Macromedia FlashPaper';
ORDCOM.InitArg();
ORDCOM.SetArg(activeprinter,'BSTR');
i := ORDCOM.Invoke(WorkBookToken, 'PrintOut', 1, DummyToken);