Questions tagged [gembox-spreadsheet]

GemBox.Spreadsheet is a .NET component that enables you to read, write, convert, and print spreadsheet files (XLSX, XLS, XLSB, CSV, HTML, and ODS) from .NET applications. With GemBox.Spreadsheet you get a fast and reliable component that’s easy to use and doesn't depend on Microsoft Excel. It requires only .NET and it’s much faster than Microsoft Office Automation!

GemBox.Spreadsheet () is a .NET component that enables developers to read, write, and convert spreadsheet files from their .NET applications.

GemBox.Spreadsheet Free is free of charge while GemBox.Spreadsheet Professional is a commercial version licensed per developer. Server deployment is royalty-free.


Support

Read Read & Write Write
XML XLS, XLT PDF, PDF/A
XLSX, XLTX, XLSM, XLSM XPS
XLSB PNG, JPG, GIF, BMP, TIFF
ODS
CSV, TSV
HTML, MHTML
PRN, TXT

Hello World

C#

// Create a new file.
ExcelFile workbook = new ExcelFile();

// Create a new sheet.
ExcelWorksheet worksheet = workbook.Worksheets.Add("Sheet 1");

// Get cell "A1".
ExcelCell cell = worksheet.Cells["A1"];

// Set cell value to "Hello World".
cell.Value = "Hello World";

// Save as XLSX file.
workbook.Save("Output.xlsx");

VB.NET

' Create a new file.
Dim workbook As New ExcelFile()

' Create a new sheet.
Dim worksheet As ExcelWorksheet = workbook.Worksheets.Add("Sheet 1")

' Get cell "A1".
Dim cell As ExcelCell = worksheet.Cells("A1")

' Set cell value to "Hello World".
cell.Value = "Hello World"

' Save as XLSX file.
workbook.Save("Output.xlsx")

Top Features


System Requirement

  • .NET Framework 3.5 - 4.8
  • .NET Core 3.1 (.NET 5 & 6 for Windows)
  • .NET Standard 2.0 (.NET 5 & 6 for Linux, macOS, Android, iOS, …)

Installation

You can download GemBox.Spreadsheet from NuGet

Or from BugFixes


Resources


Related Tags

115 questions
0
votes
1 answer

GemBox SpreadSheet and merged cells

To illustrate, create a new Excel file, with merged cell. e.g. row 2 below has columns A and B merged: If you run code like this, where worksheet is a GemBox.Spreadsheet.ExcelWorksheet: string v1 = worksheet.Cells[1, 0].GetFormattedValue(); //…
Moe Sisko
  • 11,665
  • 8
  • 50
  • 80
0
votes
1 answer

In Gembox SpreadSheet, is there a way to detect if cell contains an error?

e.g. say an excel cell has a formula like: =5/0 This displays in excel as: #DIV/0! In c#, the ExcelCell.ValueType is returned as CellValueType.String, and Excell.Value is returned as "#DIV/0!". Is there a standard way to detect if the cell has an…
Moe Sisko
  • 11,665
  • 8
  • 50
  • 80
0
votes
1 answer

Reading Excel File with Gembox - Columns.Count = 0

I'm using GemBox to read Excel files. I'm copying the fields to a DataTable, so I have to add the columns to the DataTable first. Therefore I'm using this code: For i As Integer = 0 To objWorksheet.Columns.Count - 1 objDataTable.Columns.Add(i,…
0
votes
0 answers

GemBox Spreadsheet : Why Save Excel to PDF PieChart cannot show same in Excel

from Excel File from PDF Export From Excel This Code export Pie Chart //Pie Chart var pieChart = worksheet.Charts.Add(ChartType.Pie, "A27", "G45"); pieChart.SelectData(worksheet.Cells.GetSubrange("G2:G6"), true, true); …
0
votes
0 answers

GemBox Excel Load Issue - Input string was not in a correct format

I'm using GemBox to disable the grid lines of a Bulk Excel Export I'm trying to do from my ASP.Net MVC application. Out of many sheets, for a few sheets, however, I'm getting Input string was not in a correct format error. One thing to note is that…
The Inquisitive Coder
  • 1,085
  • 3
  • 20
  • 43
0
votes
0 answers

Looping through bands in DataRow

I have the following code where I am attempting to count the rows under each grouping/band in a DataTable. This is currently counting ALL rows in the specified band index and returning that value to all band1 rows. I need a way of counting rows…
AlBundy
  • 11
  • 6
0
votes
1 answer

GemBox C# - position qr code in top right corner

I am creating a PDF-file with GemBox in my .net project and I am wondering how to position the qr code in the top right corner. With the code below, I am replacing variables in my word file and with the addition of the qr code section, the qr code…
user11718626
0
votes
1 answer

Convert DataTable to Gembox Table

So , now I have the data I need in a System.Data.DataTable . How can I convert it in a Table from Gembox.Spreadsheet.Tables?
0
votes
1 answer

Excel File doesn't show Hyperlink in protected view (Gembox and Kendo)

I have a problem with some excel files. I'have stored three excel files in the azure cloud storage. I've implemented a download option from my website. I'am opening the file via Gembox on the server to insert one link per row with the help of the…
0
votes
2 answers

Export HTML table to Excel file using C# (WinForms .NET 5)

I need to convert a HTML table with styling to an .XLSX file. I managed to do that using the free version of GemBox.Spreadsheet, for now I don't mind the limitation of the free version but the problem is that numbers are considered as text when I…
Yox
  • 313
  • 2
  • 6
  • 18
0
votes
1 answer

Importing data from DataGridView to existing Excel file using GemBox

I am fairly new to programming and GemBox. I found this code that inserts a data from a DataGridView to an existing Excel sheet with headers and footers. What happens with the code is it replaces the exisiting excel file totally and removes all the…
cc_newbie
  • 5
  • 3
0
votes
1 answer

How to insert two line (or newline) in a single Excel file through C# program

I am using a C# console application and I want to create an Excel file and insert two lines of text into a single cell in Excel. I want to insert new line character in an Excel cell from my C# program so that I have output in single cell like: this…
0
votes
1 answer

How to import specific excel range to datagridview

I want to import an excel file to datagridview using GemBox. Im fairly new to GemBox and I can't seem to figure out how. I only want to import from cell "A9" to cell "H32". var workbook = ExcelFile.Load(openFileDialog.FileName); …
cc_newbie
  • 5
  • 3
0
votes
1 answer

Chart axes in PowerPoint file

I'm creating a chart (of ComboChart type) in the PPTX file using GemBox.Presentation (together with GemBox.Spreadsheet). I'm using the code from the PowerPoint Chart example and added parts of the Excel Combo Chart example. This is what I have so…
0
votes
1 answer

Set Excel cell to TimeSpan value

I need to create an Excel file with a column containing time values (TimeSpan objects). I'm using GemBox.Spreadsheet and I can create a column with date values (DateTime objects) by using either ExcelCell.Value property or ExcelCell.SetValue…