If you have problems running Excel Command on Server

A working tip suggested by @rebmanna here: Run VBA Makro runs in Launcher, but not via ServerTask (Server version: 5.5.0.4) - #5 by rebmanna.

It references this blog post by TroyB: Troy versus SharePoint: Interactive Excel permissions.

Given the importance of the information in this post, I’m copying it here, just in case the author decides to shut down the blog.


Stumbled upon an interesting one today, where I had a legacy application that needs to open excel to generate some excel spreadsheets. But when this happened i got the usual error:

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file ‘c:\temp\test.xls’. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.

For this example the application is running under an application pool account called ExcelAppPoolAct

Obviously the first step is to grant the correct permissions in component services. To do this:

  1. Navigation to Adminstrative Tools->Component Services->MyComputer->DCOM->Microsoft Excel Application

  2. Right Click on Microsoft Excel Application and select Properties

  3. Click the Security tab

  4. Change Launch and Activation Permissions to Customize

  5. Click Edit

  6. Add ExcelAppPoolAct

  7. Check Local Launch and Local Activation

Next we need to configure the systemprofile directory. You need to create a Desktop folder in one of the following paths, dependant on which version (32-bit or 64-bit) of Microsoft Office you are running.

Office Version Folder
32-bit C:\Windows\System32\config\ systemprofile|
64-bit C:\Windows\SysWOW64\config\systemprofile|

The next step is to configure the appropriate permissions to the folders for the Application Pool account, ExcelAppPoolAct. Again the folder is dependent on your version (32-bit or 64-bit) of Microsoft Office.

Folder Required Permission
C:\Windows\System32\config\systemprofile\Desktop Read & Execute, List folder contents, Read
C:\Windows\System32\config\systemprofile\AppData\Roaming\Microsoft Modify, Read & Execute, List Folder Content, Read, Write
C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft Modify, Read & Execute, List Folder Content, Read, Write
Folder Required Permission
C:\Windows\SysWOW64\config\systemprofile\Desktop Read & Execute, List folder contents, Read
C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\Microsoft Modify, Read & Execute, List Folder Content, Read, Write
C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft Modify, Read & Execute, List Folder Content, Read, Write

1 Like