I want print an excel file on the printer, I search some code like below.

PrintJobSettings    printJobSettings = new PrintJobSettings();
    Dialog              dialog = new Dialog();
    DialogField         dialogFileName;
    str                 adobeExe;
    str                 adobeParm;
;
    dialogFilename  = dialog.addField(extendedTypeStr(FilenameOpen));
    if (dialog.run())
    {
        printJobSettings.printerSettings('SysPrintForm');
        adobeExe = WinAPI::findExecutable(dialogFileName.value());
        adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
                           dialogFileName.value(),
                           printJobSettings.printerPrinterName(),
                           printJobSettings.printerDriverName(),
                           printJobSettings.printerPortName());
        winAPI::shellExecute(adobeExe,  adobeParm);
    }
but each time, it will show me some error, see my screenshot.
I print it of my remote printer. I open the excel file and click print directly and it works.