on 05-24-2023 10:01 AM
Hi, I have a scenario where IRPA downloads excel files from SE16N. As they are being opened automatically, I need to close them right after that. I created the scenario as below:
I put wait to 3 seconds as sometimes the run was too quick and continued without closing the excel.
This job runs during the night, where it always ends on error below:
During the testing and everytime I run the job manually it never fails so I am not able to simulate the issue. Any idea what may be wrong?
Thank you
In past someone give me advice to use Custom script. I use it since and it works. This custom script close all opened excels:
function formatEscapCaracters(f) { return f.toString(). replace(/^[^\/]+\/\*!?/, ''). replace(/\*\/[^\/]+$/, '');}
irpa_core.core.log('custom script close any opened Excel', irpa_core.enums.logType.Info, 'excelAutomation');
try { var MSScrCtrl = irpa_core.activeX.create("MSScriptControl.ScriptControl"); MSScrCtrl.AllowUI = 1; MSScrCtrl.Language = 'VBScript';
var VBScode = formatEscapCaracters(function () {/*! Sub closeAnyOpenedExcel() For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = 'EXCEL.EXE'") Process.Terminate Next End Sub */});
MSScrCtrl.AddCode(VBScode); MSScrCtrl.Run("closeAnyOpenedExcel");
irpa_core.core.log('custom script close any opened Excel', irpa_core.enums.logType.Info, 'excelAutomation');
} catch (error) {
irpa_core.core.log('closeAnyOpenedExcel Exception occured:' + error, irpa_core.enums.logType.Error, 'excelAutomation');
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.