Cannot access file, being used by another process

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Cannot access file, being used by another process

Postby condornwmsn » Wed Feb 20, 2013 5:08 pm

Hello

I am migrating to generate reports in a web-service and am having a strange problem that occurs sometimes, other times not, file is ok.

Apparently the Spire.XLS is keeping the file in use after closing, and the result is a corrupted file.

20 times reapeting same operation, at least about 5 this kind of problem occurs.

I'm using version 5.8.5.4.

I tried to migrate to the latest version which I am entitled, but there was another problem with special characters, as well as the problem of file in use also occurred.

What can I do?
condornwmsn
 
Posts: 4
Joined: Tue Sep 13, 2011 9:53 pm

Re: Cannot access file, being used by another process

Postby amy.zhao » Thu Feb 21, 2013 7:15 am

Hello,

Thanks for your inquiry.
Please try the solution below to load your excel document.
Code: Select all
              using (Workbook workbook = new Workbook())
                    {
                        byte[] bytes = File.ReadAllBytes(excelfilePath);
                        using (Stream stream = new MemoryStream(bytes))
                        {
                            workbook.LoadFromStream(stream);
                        }
                    }
 


Please tell us if you still have the problem after try the code above.

Best Regards,
Amy
E-iceblue support team
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 1 guest

cron