SharePoint Products TechCenter > SharePoint Products and Technologies Forums > SharePoint - Excel Services > openworkbook always returns 'You do not have permissions to open this file in Excel Services'
Ask a questionAsk a question
 

Answeropenworkbook always returns 'You do not have permissions to open this file in Excel Services'

  • Friday, May 04, 2007 9:33 AMjason M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm having a problem opening any workbook in our sharepoint site - it's always giving me the 'You do not have permissions to open this file in Excel Services'

     

         ExcelWebService.ExcelService excel = new ExcelWebService.ExcelService();

     

         //NetworkCredential myCred = new NetworkCredential("administrator","password","bottom");
           //NetworkCredential myCred = System.Net.CredentialCache.DefaultCredentials;

         excel.Credentials = System.Net.CredentialCache.DefaultCredentials;
                

          ExcelWebService.Status[] stati;

          string ver = excel.GetApiVersion(out stati);

          string sessionId = excel.OpenWorkbook(@"http://hq-2k3:2007/DocCentre/Documents/jasontest.xlsx", "en-UK", "en-UK", out stati);

     

    The url specified in the openWorkbook call DOES open in browser - so I'm assuming that the location is a trusted location, and this is confirmed by looking at the site settings.  I hope I am right in assuming that this means Excel Services is providing the ability to render it in the web.

     

    I've changed the filename for a non existant one and it correctly tells me the file doesn't exist.  I've used the DefaultCredentials, the DefaultNetworkCredentials and tried various user accounts (they correctly return a 404 unauthorised if I set them incorrectly) but I always get the permissions error.

     

    The permissions of the file in question have been set to 'Full Control' for every group specified in the system to try and open it out.  I've tried this from within a web page and a console app with no difference to the result.

     

    What have I missed please?

     

    Jason

Answers

All Replies

  • Thursday, May 10, 2007 11:10 PMMichaelL Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Jason,

    I have just struggled with the same error.

    I eventually created a report center sub-site within the same internet site as the webpart where my code is executing and I immediately got the spreadsheet to open when it was within the same website as the calling code.

    No real idea why but cross domain data access might be an IE issue??

    Let me know if this fits or you work out why.

    Thanks

    Michael

  • Friday, May 11, 2007 8:08 AMjason M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks Michael - that is probably the cause.  I'm not sure about the IIS configuration details of the site I'm accessing, but I know different parts are accessesed through different ports, and it may be that the service needs moving into the area it's trying to access, or to become a trusted service by moving it into the appropriate area.  I'm not really very well up on this stuff TBH, I've only just started..  I DO have a feeling it might be something to do with the trusted areas configuration though, but that is just a guess.  Maybe if the trusted area is configured using a site on one port but the actual trusted area is in an area served through a different port then it doesn't work - I just don't know cos I don't have enough knowledge.

     

    I moved my service to another site which is configured differently (it all seems to be through 1 port) and it all works fine.  I'll certainly investigate the location of the service to see if I can sort it out that way.

     

    Thanks for the reply Michael - I'm sure you're on the right track

  • Monday, May 28, 2007 6:16 AMVasu3 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Refer the ExcelWebService from the URL where your docment center is created.

     

    http://<sharepointserver>/sites/<sitename>/_vti_bin/excelservice.asmx

  • Monday, May 28, 2007 9:11 AMjason M Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi - I wasn't having trouble getting hold of the actual service - I was referencing that already as you have shown - it's the permission on the actual file I was trying to retrieve that was giving the problem.

    Thanks
  • Wednesday, May 30, 2007 4:51 AMCoskun Cavusoglu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
     

    Hi Jason,

     

    Have you set your library as a trusted location? If not, you need to add http://hq-2k3:2007/DocCentre/Documents as a trusted location from the SSP settings.

     

    The following is a link to an article that shows the steps on adding it as a trusted location.

    http://technet2.microsoft.com/Office/en-us/library/00fc7447-6c0c-435c-840f-b1033710fe561033.mspx?mfr=true

  • Wednesday, June 06, 2007 3:43 PMShahar Prish - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Jason,

     

    Please output the contents of the .URL of the proxy you are using (excel.Url in your code) and see if it makes sense (it should be the ASMX file inside the proper site inside your server).

     

    If it's the correct URL, please post and I will see if I can figure out what's going on.

  • Thursday, August 02, 2007 4:00 PMJuan.m.laros Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    hey, I had the same problem and it was the fact that I was not pointing to the right web service, I was pointing to an excel web service just not the right sharepoint server. I am running code right on the server and I searched for web services on my local machine and I couldn't find the server I was workin on, so I added a shareservice one, don't do that, you can actually search for your own just type in the URL path and search for your own,

      hope that helps

     

    Juan

  • Monday, October 26, 2009 10:40 AMMuhammad Tariq Khan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Use following steps to resolve the issue
    1. In central admin site, in operations page, under services in the server farm enable the Excel Services.
    2. Open up the Shared Services Admin site. Under “Excel Services settings” section, open the ‘Edit Excel Services settings ‘. Set the File Access Method to Process Account. In the same page under the ‘External Data’ section assign the appropriate user.
    3. Back to SSP Admin site. Open the “Excel Services Trusted File Locations”. Give the URL Address of the location where you publish your excel workbooks. Potentially this will be the document library of type excel services. If it’s a document library make sure not to put the complete URL i.e DON’T PUT something like http://server:5050/doclibraryname/Forms/AllItems.aspx, instead put it like http://server:5050/doclibraryname. In my case this is the main reason which showed the above error. If I use full URL I get those errors and no site mentions this after spending hours searching on google.
    4. In the same page under the ‘External Data’ select the Trusted data connection libraries and embedded or just the Trusted data connection libraries.

    Regards,
    Muhammad Tariq Khan.
    • Proposed As Answer bysaqj Monday, November 23, 2009 7:18 AM
    •  
  • Monday, November 23, 2009 7:18 AMsaqj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you Muhammad.
    Your answer helped me.
    Although I eliminated the "Forms/AllItems.aspx" part from the url, I still couldn't get the file to work.
    The only thing that was missing is deleting the "/"  after the document library name.


    Thanks again.