DEV Community

Cover image for Convert a document to Excel in C#
Atir Tahir
Atir Tahir

Posted on • Originally published at blog.groupdocs.com

2 1

Convert a document to Excel in C#

Is it about converting a particular file format, lets say PDF to Excel spreadsheet? The answer is No. There are a bunch of regularly used and common file formats (Word, Presentation, Image, PDF etc) that you can convert to Excel using GroupDocs.Conversion for .NET.

Does it require any third party software installation?
Absolutely not. This is a back-end API that could easily be integrated in any new or existing .NET application without any dependency. Using a single DLL you can develop a web, console or desktop application.

How simple is it?
All it takes is a few lines of code.

using (Converter converter = new Converter("sample.docx"))
{
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.Convert("converted.xlsx", options);
}

Conversion to spreadsheet format could be triggered by following the below steps:
  • Create new instance of Converter class and pass source document path as a constructor parameter
  • Instantiate SpreadsheetConvertOptions class.
  • Call Convert method of Converter class instance and pass filename for the converted document and the instance of SpreadsheetConvertOptions from the previous step

GroupDocs.Conversion can convert any source document to the following spreadsheet formats: Xls, Xlsx, Xlsm, Xlsb, Ods, Ots, Xltx, Xlt, Xltm, Tsc, Xlam, Csv. When just instantiate the SpreadsheetConvertOptions class without specifying the target format explicitly, Xlsx will be used as a default format.
In order to get release and features related updates, please visit blog.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

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

👋 Kindness is contagious

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

Okay