0

I'm trying to read an Excel File where Cells have styles like shown below. I would like to convert the cell to RTF, HTML or Text.

enter image description here

In Microsoft Excel 16.0 Object Library has a lot of functionalities that deals with this and has some functions to convert formats. And it's really easy to use. I only use this on Windows Dev though.

Since I'm trying to stay away from Windows App development and more on Web Dev, I want to use OpenXml, and honestly, it's a little bit confusing how to get values or styles. There's so many objects with *Part in it. I recently created a WebApi that reads an excel file but not sure how to use include styles.

I've been searching if it's possible to convert the OpenXML Stylesheet into HTML but can't find anything. related to it. Mostly, it's writing with Stylesheet but not reading.

1 Answers1

0

you can use Microsoft.Office.Interop.Excel

may this link help you : Reading Excel data and cell formatting in C#

Isaac Be
  • 81
  • 1
  • 10
  • Thanks Isaac. So I was playing with it and It is much better than the OpenXML. A bit slow but easier to implement. My question is about getting the formatted text. There is a property called RichText, I tried putting the cell.RichText.Text into a RichTextBox but it's not formatted. Does this mean that I need to parse the Styles manually? – Reydan Gatchalian Jun 07 '20 at 19:31