1

I need to import a text, textbox name, position top and left and width and height of a textbox control from xls file in .NET Core application. I know how to do it with xlsx file, but I am struggling to find information about shapes in xls file format.

Right now I am using ExcelDataReader library to retrieve information from cells, but I don't think that this library can be used for shapes, or unless I didn't find any information about it yet.

Stream filestream = file.OpenReadStream();
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
IExcelDataReader reader = ExcelReaderFactory.CreateBinaryReader(filestream);

var dataSet = reader.AsDataSet();
var dataTable = dataSet.Tables[0];

//TODO: import textbox information
//..

I really appreciate any help here.

EDIT: I found some information regarding import of shapes from .xls using Microsoft.Office.Interop.Excel library, but unfortunately this library doesn't work with .Net Core Web API.

ekad
  • 14,436
  • 26
  • 44
  • 46
  • Have you tried [EPPlus.Core](https://github.com/VahidN/EPPlus.Core)? The original EPPlus supported shapes and this .NET Core port might be able to do the same? – Balah Oct 15 '18 at 05:19
  • I haven't tried it myself, but while searching for libraries I found information that EPPlus works only with xlsx file format. I found it here: https://stackoverflow.com/questions/26152215/error-when-trying-to-read-an-xls-file-using-epplus – Anastasia Gabriel Oct 16 '18 at 06:50

0 Answers0