Excel Services Fix – "The workbook cannot be opened".


When opening an Excel workbook (.xlsx) in the browser the error “The workbook cannot be opened” is thrown:

This is caused by the account running Excel Services not having proper permissions to the Content Database.  When you upload an Excel workbook to a SharePoint library, the workbook is stored as blobs in the Content Database.  When you choose to open this in Excel Services, the account running Excel Services needs to retrieve and reassemble the workbook.  If the account running Excel Services lacks proper permissions, “The workbook cannot be opened”.

We have a KB on how to resolve this issue:

The Excel Services Application for SharePoint 2010 does not load or display workbooks

http://support.microsoft.com/kb/981293

 

In this blog, I will step you through this KB; where to collect data and explain what the two below SharePoint Management Shell Commands do:

 

$w = Get-SPWebApplication –Identity <URL of the Web application>
$w.GrantAccessToProcessIdentity(“<insert service account>”)

 

You need to find the <URL of the Web application>.  To do this:

 

1. Browse to the report library where the failing workbook is located and make note of the URL.

 

 

2. Central Administration > Application Management > Manage web applications compare the URL to the list of Web Apps.  Find the correct Web App URL and add it to “URL of the web application”.

 

 

You now have the first command: 

 

$w = Get-SPWebApplication –Identity http://tschauer

 

3. Central Administration > Security > Configure Service Accounts > from the first dropdown, select the application pool running “Excel Services Application” and add that account where is says “<insert service account>”.

 

You now have the second command:

$w.GrantAccessToProcessIdentity(“Devtest\Excel_Services_Account”)

So now you can run these commands by following the below steps:

1. Click Start, click All Programs.
2. Click Microsoft SharePoint 2010/2013 Products.
3. Click SharePoint 2010/2013 Management Shell.
4. At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press ENTER:

$w = Get-SPWebApplication –Identity http://tschauer
$w.GrantAccessToProcessIdentity(“Devtest\Excel_Services_Account“)

When you run these commands you are:

1. Adding the account running Excel Services as a User to the Content Database (Security > Users).
2. Giving the account running Excel Services the SPDataAccess Membership (Account > Membership)
3. Giving the account running Excel Services Full Control to the Web Application (Via “Policy for Web Application”)

Comments (48)

  1. PaulE says:

    Thanks! This did the trick for me when having this error in SharePoint 2013, too.

  2. Joanne Mason says:

    Superb. Fixed my problem, thank you.

  3. Catherine Colbert says:

    Thank you so much! This worked BEAUTIFULLY for SharePoint 2013! Wonderful instructions, very detailed, and fast to implement.

  4. Thanks alot for putting this.  Works like charm!

  5. Mark Treacy says:

    Thanks Tom S., much appreciated clear to implement fix!

  6. Abdul Hafees says:

    Great. It fixed the issue of my new site collection with separate database.

  7. Bhanu says:

    Thank you that was very helpful!

  8. MaryL says:

    Thanks very much.

  9. MaryL says:

    Thanks very much.

  10. YBP says:

    Thanks Tom

  11. Ajeet Kumar Singh says:

    Nice post Tom.
    But, Need more in my case.You can find here
    http://asharepointsolutions.blogspot.in/2014/03/excel-services-application-issues-sp.html

  12. Edgar Corona says:

    Thanks! Also work in SharePoint 2013 + Adding https on the trusted file locations by default it’s only http

  13. festlizeng says:

    Excel Fix Toolbox prog is effective, especially when you want to restore the signatures. Try it for recovering damaged files (xls, xlsx, xlt, xlmx), sheets, documents.
    http://www.excel.fixtoolbox.com/

  14. Harry says:

    That didn’t work. I can’t open any Excel files in the browser. I need to be able to do this to use excel services.

  15. iman says:

    thank you . for me only executing 2 lines of power-shell fixed the issue which was due to migrating WSS_content to another server. for me the new server was SQL server 2012 which i used the always-on listener name instead of actual servername.

  16. srikanth says:

    I dint fix my issue. I have tried lot many options but no resolution. I donno whts causing the issue. Can anybody help.

  17. BB says:

    You are awesome. So simple and worked perfectly.

  18. Mary Wang says:

    Thanks, it works well!

  19. Andrew MacGregor says:

    I am disgusted that Microsoft allows this problem to exist with a standard Office 2013 installation and a standard SharePoint 2013 installation both updated automatically.
    How totally incompetent does Microsoft have to be to leave this issue out there. What gives you the right to waste people’s time fixing something that you should have fixed?
    I also suffered with the recent Office 2013 update that needed to be fixed, because it would not open Outlook and even stopped my computer connecting to the web. What gave you the right to waste my weekend like this?
    I despise you Microsoft.

  20. alex says:

    It works! Thanks a lot.!

  21. Dejan says:

    Worked like a charm. Thanks!!

  22. D_Good says:

    It worked, but as usual SharePoint is just counter intuitive. I had this issue on just one site collection, yet the fix was at the farm level, go figure. Thanks!

  23. Prakash says:

    Thanks i have tried all the steps which you have mentioned, when ever i click the browse button the error remains same, but i have entered the excel file URL manually and clicked save then the data appears.

  24. Hafeez says:

    Thanks, it solved the issue.

  25. Mohamed says:

    Hi guys,
    I am getting same error .please help me.

  26. Pule Babie says:

    Beautiful

  27. Param says:

    Thank you that was very helpful!

  28. douglasslayton says:

    Excel file recovery tool extract data from damaged XLS/XLSX files. It is integrated with powerful algorithm that ensures quick and complete recovery of damaged Excel files. To get more details visit here :-
    http://www.recoverydeletedfiles.com/excel-file-recovery-tool.html

  29. John says:

    Great post! Worked perfectly in 2013.
    Thanks

  30. Matt D says:

    Thanks very much – spot on instructions and worked first time!

  31. alex says:

    Thank you very much for posting this. It helps a lot.

  32. bbryce says:

    Would this fix explain and resolve why a file with this error that is reloaded to SharePoint with a different name / file name will open, but the first file continues to give the error? Thanks for any help you can give 🙂

  33. Yeswanth says:

    Thanks. This solution worked for me.

  34. Shri says:

    this worked!! Thanks.

  35. VK says:

    Thanks alot. Nice post!

  36. bhashwar bhattarai says:

    Thank You. This was very helpful.

  37. Chad says:

    You saved my a weekend of pain. Thank you.

  38. Kenneth says:

    Awesome, thanks! Worked like a charm on my new SP2013 installation.

  39. Wolfe says:

    Perfect! Thanks.

  40. Rabah says:

    Thank you ! it work good now !

  41. goran says:

    hi there,
    our excel (2010) stop opening file on share point server and crash, which we rent from Apps4rent provider. They said is on our site problem. I did try using excel on office 2007 and it is work no problem. Thank you in advanced

  42. goran-88 says:

    Hi there,
    our excel (2010) stop working and crash when try to open file on share point server we are renting space with Apps4rent provider. Same is on any pc running office 2010 I did try with excel. I did try with excel 2007 and open file with no problem. Thank you
    in advance for help…

  43. Benjamin Gemperle says:

    $w.Update() seems to be also required sometimes. We did a few upgrades from Excel Services 2010 to Excel Services 2013 and got them all to work finally. For one Web Application I got this exception for some Excel-Files:

    ExceptionHelper.IsUnrecoverable: Encountered a NullReferenceException, this isn’t expected. Exception=System.NullReferenceException: Object reference not set to an instance of an object.

    at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)
    at Microsoft.SharePoint.SPSite.GetSPRequest()
    at Microsoft.SharePoint.SPSite.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates)
    at Microsoft.Office.Excel.Server.MossHost.SharePointHelperMethods.GetSite(String fileLocation, IClaimsIdentity claimsIdentity)

    at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)

    After running $w.GrantAccessToProcessIdentity() and $w.Update() this issue was fixed.

  44. Jason Ralston says:

    Excellent very helpful.

  45. Roberto Lima says:

    Thanks

  46. Sanjay Tailor says:

    Fantastic help.

  47. Marcos Nunes says:

    Thank you! IT worked here.

  48. baharak says:

    Fix my problem, thank you