Some of the files I'm trying to open may be already opened in Excel by other users. When using Excel automation, I simply tested to see if I could get exclusive access by trying to open the file as a stream, then set a locked flag based on that. Depending on the flag I would:
If bLocked Then oWB = oXL.Workbooks.Open(strDailyPath & strDailyFile, ReadOnly:=True) Else oWB = oXL.Workbooks.Open(strDailyPath & strDailyFile) End If
Note that using Excel there was no problem opening a file already open as long as I opened it readonly. Using Aspose, I don't have the option of specifying the open mode. In searching the site, a similar question was addressed a couple years ago, and the answer was to have the users open the files as readonly. This isn't an option.
It doesn't seem like aspose is really opening as readonly (as mentioned in the article I found). I can open the file readonly using the FileIO functions even if Excel has the file, but that doesn't help with opening it under aspose. I can also copy the file within my program while it's open in Excel, and I can then open the copy. This would work as an interim solution, but it seems like Aspose.cells should be able to open the file directly if it is using readonly.
Well, you cannot load/open a file that is already opened exclusively in MS Excel using Aspose.Cells for.NET. Anyways, we will check your request and get back to you soon.
I first opened the excel file named sample.xlsx in Microsoft Excel and then executed the following sample code using the latest version: Aspose.Cells for .NET v8.9.2.7 and Aspose.Cells loaded it fine without throwing any exception. So this issue has been fixed now.
For your information, when you read/open an Excel file via Aspose.Cells APIs, it actually creates a replica of the original file and does not process on the original file. So, there is no problem if you have already opened that file into MS Excel. But, please note, when you try to re-save the file with same name @ its original location, you will get an error as the file is already opened in MS Excel or opened by other process.
my file in shared folder every day some one need to update data
when he tray to open the file he get it’s used by other user and can’t open for editing
Do you mean he gets an exception (i.e., the file is used by another user/process…etc.) when opening the file by Aspose.Cells APIs (via the line of code, e.g Workbook workbook = new Workbook(filePath);)? Please provide us your template file, sample code (runnable) if it is more than one line as above and steps (involved) to reproduce the issue on our end, we will check it soon
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.