Task scheduler problem with excel files

Hello, I have the following problem. I need to process Excel files. When starting the robot from the Studio or cmd, everything is fine - the processing is performed. However, when starting it through the task scheduler, it gives the following error - Failed opening the Excel file … Possible reasons: the file is corrupt, the file is already used by another process, you don’t have permissions to open the file or the file has incorrect sensitivity label.
If anyone has had such a problem, could you please share?

Its not recommended and I think no longer supported properly to start by the task scheduler.

The intended way is to run these via an Unattended Robot and a time trigger in the Orchestrator.

Thank you,
I’ll keep that in mind for the future, but is there any kind of workaround for now, even if temporary? I understand Task Scheduler isn’t recommended or properly supported anymore, but just wondering if there’s a quick fix before move to Orchestrator.

Hi @zoya.dzhuneva

This issue may occur because the task scheduler runs the robot in a different user session without UI or Excel access. Ensure the scheduled task is set to run with highest privileges and the user has access to the file path. Also, use “Use Excel File” with “Visible” checked or switch to Workbook activities if Excel is not available in background.

If you found helpful please mark as a solution. Thanks
Happy Automation with UiPath

I am not aware of one but also cannot advise to do so since I think you might be breaking the licence agreement to be using it in such a way as you would be setting it up so an attended or developer licence can be used in an unattended way.

In my opinion, the ‘quick fix’ is to run it manually from Assistant (which is allowed as then its an attended automation) whilst you transfer it to a fully unattended setup triggered from the Orchestrator.

Giving you more info:
The exact message is … Possible reasons: the file is corrupt, the file is already used by another process, you don’t have permissions to open the file or the file has incorrect sensitivity label.
Checked and ok: the file is corrupt, the file is already used by another process
Run from cmd is OK.