Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Unassigned: Unable to create mutex (Exception from HRESULT 0x80131464) - SaveAs into MemoryStream [9368]

$
0
0
Hi,

I would like to know if you have any idea with the following issue, basically we are opening an excel file (xlsm) and doing some changes on it (cell colors, adding values to some cells.. etc nothing complicated)... when we do the save as into an Memory Stream we are getting the following issue: Unable to create mutex (Exception from HRESULT 0x80131464)... something that we discovered is that this error is being triggered __only__ when file size is higher than 2.7 MB.

See below how we are saving the file in the Memory Stream.


Dim stream As MemoryStream
Dim workbook As XLWorkbook (Workbook that is being manipulated).

Dim fs As MemoryStream = New MemoryStream()
excelWorkbook.SaveAs(fs)
fs.Seek(0, SeekOrigin.Begin)
fs.Position = 0
Return fs


Again thank you for this software, its amazing.
Comments: Hi MDeLeon, Thanks for the reply, We just checked your code and I would like to mention that we are creating a ASP.Net application and the file we are manipulating is stored in a database, so, below how we get the file from the database: Dim stream As MemoryStream Dim workbook As XLWorkbook Dim data As [Byte]() data = cls.File_ _(the class is returning a file in bytes)._ stream = New MemoryStream(data) workbook = New XLWorkbook(stream) _This is the workbook that we are manipulating._ . . . . . and at the end we are trying to save the workbook manipulated into a MemoryStream to send the new file to the user. Dim fs As MemoryStream = New MemoryStream() excelWorkbook.SaveAs(fs) fs.Seek(0, SeekOrigin.Begin) fs.Position = 0 __Important:__ We are doing everything in code behind and for that reason we do not have the path of the file. Thanks in advance.

Viewing all articles
Browse latest Browse all 1877

Trending Articles