"The file that you selected could not be found. Check the spelling of the file name and verify that the location is correct" when calling ExceService.OpenWorkbook in sharepoint with non adiministrator priveleges
-
2010年2月17日 下午 01:21hi all
how are you
i wish anyone could help me in this problem
i have a document library list in sharepoint that contain excel files
i have an asp page that will show the values of some excel cells in a grid
i am using the class Microsoft.Office.Excel.Server.WebServices.ExcelService to open the workbook of any excel file found in the documant library
i have created an instance of the class and call the openworkbook method of the class.
only the administrator have access to the list that contain the excel files
my problem is that when i try to open the excel file with any user that doesnt have access to the sharepoint documant library mentioned above
i get this error:The file that you selected could not be found. Check the spelling of the file name and verify that the location is correct.
so how to open the excel file in the documant library with administrator priveleges- 已變更類型 Mike Walsh FIN 2010年2月17日 下午 03:03 always use the question type so people get credit for replies
- 已編輯 Mike Walsh FIN 2010年2月17日 下午 03:04 "i get the error: " deleted. Unnecessary. The " " indicates it's an error
所有回覆
-
2010年4月13日 上午 03:53
hanliang:
It is not helpful when people propose their own posts as answers.
Please propose the good answers of other people and wait until someone else proposes your post(s).
(Moderator)
FAQ sites: (SP 2010) http://wssv4faq.mindsharp.com; (v3) http://wssv3faq.mindsharp.com and (WSS 2.0) http://wssv2faq.mindsharp.com
Complete Book Lists (incl. foreign language) on each site. -
2010年4月23日 上午 01:17
I am currently having a very similar problem where and Administrator can open Excel Calculation Service files but a user with Read permissions cannot. I get this error:
"The file that you selected could not be found. Check the spelling of the file name and verify that the location is correct. Make sure that the file has not been renamed, moved, or deleted."
This is with the default Reports tab created when you create your first site with SharePoint. I have added Authenticated Users with read and verified that an unprivliged user can browse the site. The issue comes up trying to open the workbook or use Excel Calculation Services. The permissions on the workbook look the same as the rest of the site so what gives?
Wayne
-
2010年4月26日 上午 08:22
dear wayne
did you solve your problem because till now i havent solved my problem
Thanks a lot
-
2010年4月26日 下午 04:21
Hi Mohammad,
Yes, I resolved the problem I was having. It was due to an invalid Service Principal Name as the biggest problem. I needed these SPNs to have the correct name of my Shared Service Provider.
I had: MSSP/<servername>:56737/SharedServices & MSSP/<servername>:56738/SharedServices
I needed: MSSP/<servername>:56737/SSPAdmin where SSPAdmin is the actual name of my Shared Service Provider (I had rebuilt this several times during the course of building this farm).
My systems are 3 servers (web front end, app/index server, SQL Server) running 2008 R2 and SharePoint 2007 R2. All systems/software are x64 and Kerberos security is set on all systems.
I also had to change IIS settings, I set Office Server Web Services for Kerberos by selecting IIS | Authentication | Windows Authentication | Advanced Settings | Enable Kernel-mode Authentication to checked. Then under Management | Configuration Editor | System.webServer | Security | Authentication | Windows Authentication | useAppPoolCredentials = True. Under Application Pools the OfficeServerApplicationPool should be running under the Netrwork Service Identity.
In SharePoint Users must have at least SharePoint Group Read permissions to the library where you are storing your Excel files. Set the library for either no versioning or only Publish Major Versions as only approvers can read minor versions.
I hope this helps,
Wayne
-
2011年5月31日 上午 10:19The above solution did not help. I am trying to upload an excel to a document library and from there the data in the excel needs to go to sql server. It is working fine on dev but giving the above error on production. help
Thanks, Swati Jain | http://swatigoilajain.blogspot.com/ -
2011年7月13日 上午 06:56
In the following Directory Management Center, add a map would be nice
Central Administration --System Settings --Farm Management --Configure alternate access mappings
-
2012年3月15日 上午 11:00I solved that problem using a program called long path tool or something like that. You can download it from here. It also is an answer to many problems.
-
2012年4月5日 下午 10:10
Mohammadjizi,
Please look into the thread http://social.technet.microsoft.com/Forums/en-US/sharepointexcel/thread/ccb1e50b-2bc5-4969-b6a1-8de1f3ae9c78 and try use the code posted in the thread, though the link talks about refresh data connections, but the link contains the code snippet of opening Excel workbook with specified path OR you can use the below code
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Web.Services; using Microsoft.SharePoint; using Microsoft.Office.Interop.Excel; using Microsoft.Office.Excel.Server.WebServices; namespace RefreshDataConnections { class Program { static void Main(string[] args) { // Instantiate the ExcelService class. excel.ExcelService xlservice = new RefreshDataConnections.excel.ExcelService(); xlservice.Credentials = System.Net.CredentialCache.DefaultCredentials; excel.Status[] outStatus; RangeCoordinates rangeCoordinates = new RangeCoordinates(); string sheetName = "Sheet1"; // Set the path to the workbook to open. // TODO: Change the path to the workbook // to point to a workbook you have access to. // The workbook must be in a trusted location. string targetWorkbookPath = "http://server/Shared%20Documents/BillofMaterials.xlsx"; // Call the open workbook, and point to the trusted // location of the workbook to open. string sessionId = xlservice.OpenWorkbook(targetWorkbookPath,string.Empty,string.Empty, out outStatus); // Set the cell located in the first row and // ninth column to 300. xlservice.Refresh(sessionId, "AdventureWorks%20BillOfMaterials"); byte[] workbook = xlservice.GetWorkbook(sessionId, RefreshDataConnections.excel.WorkbookType.FullWorkbook, out outStatus); // Write the resulting Excel file to stdout // as a binary stream. BinaryWriter binaryWriter = new BinaryWriter(Console.OpenStandardOutput()); binaryWriter.Write(workbook); binaryWriter.Close(); } } }
Let me know if you require further information
Best Regards, G Vijai Kumar | My Sharepoint Blog
-
2012年9月9日 上午 04:47
In my situation, I should add "Alternate Access Mappings "
the host name is : sps10r2-112
so I can use http://sps10r2-112/documents/... to visit the xlsx file
I also can use a DNS name to visit to like : http://sp2010.imm.myname.com/documents/...
if I forget to add a address mapping record, I will get a lot of warning log in application log, and the Excel file in this document can't be open, the error just like you.
so, in Center administration->system settings->Configure alternate access mappings
add Internal URLS
http://sp2010.imm.myname.com/ internet http://sp2010.imm.myname.com/
it worked
- 已編輯 zohar871 2012年9月9日 上午 04:50

