Opening the Excel file in the script fails with error "Microsoft Excel cannot access the file"


The project has a script that opens the Excel file using Microsoft.Office.Interop.Excel and System.Runtime.InteropServices.

The script fails with Microsoft Excel cannot access the file error.

The following points were checked:

  • The Processing Station computers have Microsoft Office installed and activated.
  • The file is not in use (is not opened by any other program or Excel).
  • The file path is correct.
  • The user that runs Processing Station has Administrator rights and has full access to the Excel file.
  • The Excel file is not corrupted.


The user that runs the Microsoft Excel Component Service may have insufficient rights.


Explicitly specify the user with Administrator rights and with full access to the Excel file in the Microsoft Excel Component Service:

  1. Open Component Services.
  2. Navigate to DCOM Config > Microsoft Excel Application.
  3. Open its properties and switch to the Identity tab.
  4. Specify the new user.

Have more questions? Submit a request



Please sign in to leave a comment.

Recently viewed