I am using EPPlus to generate an XLSX file in C#. As soon as I instantiate the ExcelPackage with a memory stream - I get the error: > "A disk error occurred during a write operation. (Exception from HRESULT: > 0x8003001D (STG_E_WRITEFAULT))" Code is: MemoryStream stream = new MemoryStream(); using [...] read more
I am using EPPlus to read .csv file in vb.net. When I run this code, I get the error "A disk error occurred during a write operation. > (Exception from HRESULT: 0x8003001D (STG_E_WRITEFAULT))" Here is my code : Public Function ImportExcelSheet(ByVal filePath As String) As DataTable Dim dtImportData As New [...] read more
using .net 4.5 I'm trying to read .xls/.xlsx file using EPPlus (v4.0.4), but get an error. SO has questions on the same error but none relate or solve my problem. protected void Page_Load(object sender, EventArgs e) { GetDataTableFromExcel(@"D:\test.xlsx"); } private DataTable GetDataTableFromExcel(string path, bool hasHeader = true) { using (var [...] read more
In an ASP.NET MVC Core (.netcore2) application, I'm using the following method to read an Excel file. [HttpPost] public IActionResult Import (IFormFile importFile) { using (var excel = new ExcelPackage(importFile.OpenReadStream()) { var sheet = excel.Workbook.Worksheets.FirstOrDefault(); if (sheet == null) return BadRequest("No worksheet."); var events = /* import logic */ return [...] read more
I have an error while trying to read excel files (xlsx) which were saved in Excel 2007 using EPPlus library. Some workaround: 1. ASP.net mvc 5 app with EPPlus v. 4.0.4.0 2. User can download template file from my site, then fill required data in it, and upload it back. [...] read more
Im upload an excel file and trying to load it into a ExcelPackage. Like this public static void ImportStuff(Stream stream) { using (ExcelPackage package = new ExcelPackage()) { package.Load(stream); ... My calling method gets the stream from an uploaded file public async Task<ActionResult> UploadCsv(int Id, HttpPostedFileBase myfile) { ImportProducts(myfile.InputStream); } [...] read more
I found a thread on SO and am attempting to import a csv or xls or xlsx into a C# DataTable - but I am getting the below stack trace error: System.Runtime.InteropServices.COMException HResult=0x8003001D Message=A disk error occurred during a write operation. (Exception from HRESULT: 0x8003001D (STG_E_WRITEFAULT)) Source=EPPlus This is the [...] read more
i am using using OfficeOpenXml; for reading excel file and its working fine with other reading file but for one perticular file i got above mention error. check this image [https://i.stack.imgur.com/wJPZi.png] public ReadExcelFile(Stream stream, string worksheet, List<ExcelColumnMapping> columnMapping, ITypeConvert typeConvert = null, int headerSize = 1) { _stream = stream; [...] read more
> i am working in nopcommerce solution 3.90, while importing products, from > excel file i get this exception. my code is as follow public virtual void ImportProductsFromXlsx(Stream stream) { try { #region Import business Logic using (var xlPackage = new ExcelPackage(stream)) { //get the first worksheet in the workbook [...] read more
I am trying to export an excel file using EPPlus if (FileUpload1.HasFile && Path.GetExtension(FileUpload1.FileName) == ".xlsx") { bo.ExcelFile = txtFileName.Text; bo.ExcelFileBranch = txtBranchName.Text; bo.ExcelFileFromDate = txtValidFrom.Text; bo.ExcelFileToDate = txtValidTo.Text; using (var excel = new ExcelPackage(FileUpload1.PostedFile.InputStream)) { var tbl = new DataTable(); var ws = excel.Workbook.Worksheets.First(); var hasHeader = false; // [...] read more
I am using EPPlus on C# MVC to load excel files into memory. I am taking the stream from a file upload: model.File.InputStream and pass this to the ExcelPackage.Load() Method. It works great for files < 40 MB. But for larger files, I get the error: > An exception of [...] read more