i need to close workbook opened file in memory after reading and save data
becuse user when he tray to open file he opened as read only because it opened by other user (aspose workbook)
this my code
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(AttachedFile);
MemoryStream ms = new MemoryStream();
workbook.Save(ms, Aspose.Cells.SaveFormat.MHtml);
ms.Position = 0;
StreamReader sr = new StreamReader(ms);
HtmlBody = sr.ReadToEnd();
workbook.Dispose();
ms.Close();
sr.Close();
Your code looks to me Ok. Do you find any issue with it or you need something else? Please elaborate your issue with complete details and samples, we will check it soon.
PS. please also see the reply here for your reference:
my file in shared folder every day some one need to update data and to send automatically by email
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 open 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) 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.