DEV Community

IronSoftware
IronSoftware

Posted on • Originally published at ironsoftware.com

2 2

Convert Excel to HTML

How to convert "Excel to HTML" in C#.

C#:

using IronXL;
using IronXL.Options;

WorkBook workbook = WorkBook.Load("test.xlsx");

var options = new HtmlExportOptions()
{
    //This is how we can make row/column numbers visible in html document
    OutputRowNumbers = true,
    OutputColumnHeaders = true,
    OutputHiddenColumns = true,

    //This is how we can make hidden rows/columns visible in html document
    OutputHiddenRows = true,
    OutputLeadingSpacesAsNonBreaking = true
};

//This is how we can export workbook to the HTML file
workbook.ExportToHtml("workbook.html",options);
Enter fullscreen mode Exit fullscreen mode

VB:

Imports IronXL
Imports IronXL.Options

Private workbook As WorkBook = WorkBook.Load("test.xlsx")

Private options = New HtmlExportOptions() With {
    .OutputRowNumbers = True,
    .OutputColumnHeaders = True,
    .OutputHiddenColumns = True,
    .OutputHiddenRows = True,
    .OutputLeadingSpacesAsNonBreaking = True
}

'This is how we can export workbook to the HTML file
workbook.ExportToHtml("workbook.html",options)
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay