Questions tagged [spreadsheetlight]

SpreadsheetLight is an open source Open XML spreadsheet library for .NET Framework written in C#, and is released under the MIT License.

SpreadsheetLight is an open source Open XML spreadsheet library for .NET Framework written in C#, and is released under the MIT License.

You can create new Open XML spreadsheets, or work with existing Open XML spreadsheets that are compatible with Microsoft Excel 2007/2010/2013 and LibreOffice Calc.

Links

Website

Tutorials

62 questions
1
vote
0 answers

Create Excel Form Control - Button

I have a project that is using the following three libraries to access XLSM documents Open XML Closed XML Spreadsheet Light I'd now like to create a Form Control (a button) that will have a macro assigned to it (just a public function I've created…
Miles
  • 5,646
  • 18
  • 62
  • 86
0
votes
0 answers

Whenever I open a preexisting spreadsheet using SpreadSheetLight then go to save that modified file, the spreadsheet is corrupt

I have repro'd a minimal, reproducible example. The "Book1.xlsx" is a blank, brand new excel document. When I run this code, the file "Book2.xlsx" pops up in my folder. When I go to open "Book2.xlsx", I get an excel error. The file cannot be…
aberns
  • 3
  • 1
0
votes
1 answer

Set numeric cell value to be formatted as #,##0.00

In SpreadsheetLight, how can I set the numeric value into a #,##0.00 format? Tried using Format(value, "#,##0.00") but the output Excel file shows warnings that 'Number in this cell is formatted as text or preceded by an apostrophe'. Tried the…
F0r3v3r-A-N00b
  • 2,903
  • 4
  • 26
  • 36
0
votes
1 answer

Spreadsheetlight column chart when there are more rows than columns

My problem is similar to this question SpreadSheetLight Column chart. However the problem is triggered when the number of rows outpace the number of columns, the chart automatically "invert" converting to a Row chart, where column chart is…
CoffeDeveloper
  • 7,961
  • 3
  • 35
  • 69
0
votes
0 answers

How do I remove extra whitespaces from all cells using spreadsheetlight and c#?

I'm using SpreadsheetLight library to read/write *.xlsx files. In some of my files there are a lot of cells which have extra whitespaces in them. How do I remove them efficiently ? Can something like below work and be efficient ? SLDocument…
0
votes
3 answers

C# SpreadsheetLight corrupts excel file after save

Due to some issues by running .xlsm files over the network it was decided not to use VBA anymore and to develop standalone apps that will edit regular excel files. Since I have a some C# and Visual Studio knowledge I decided to use those tools.…
0
votes
0 answers

SpreadsheetLight Set X axis as "HH:MM:SS"

I made a scatter chart with VS C# 2022 using SpreadsheetLight library. First column is DateTime, it doesn't show as Time in chart, any hint will be appreciated very much, as I have been for days with this problem. Here's my code: private void…
0
votes
1 answer

Is there a way to write a spreadsheetlight excel file directly to blob storage?

I am porting some old application services code into Microsoft Azure and need a little help. I am pulling in some data from a stored procedure and creating a SpreadsheetLight document (this was brought in from the old code since my users want to…
0
votes
0 answers

SpreadsheetLight. Search and Replace

I have "source.xlsx" and "destination.xlsx". Source.xlsx has a list of serialNumbers, one per row (in column "SerialN"). Destination.xlsx has the same serialNumbers, one per row (in column "SerialN"). I wish to go trough each of the serialNumber in…
0
votes
1 answer

SpreadsheetLight Updating excel file

I would like to read the excel file then find the correct row and add a value to that row But I am getting a error message file is used by another process. I have add the file to the FileStream so I am not sure why I am getting this…
user5843610
0
votes
0 answers

C# the number in this cell is formatted as text

I am using C# & spreadsheet light to export datatable data to excel. my code is working but when i open the excel file then i found this warning is showing for most of the cell value. the warning message is the number in this cell is formatted as…
T_Zacks
  • 101
  • 2
  • 17
0
votes
1 answer

SpreadsheetLight get an excel cell value beginning with aposthrope

When I read an excel cell value using SpreadsheetLight - I get the cell value without the leading apostrophe. When the cell value is 'Something I only get Something. I understand that the apostrophe has a special meaning for excel - but I really…
Zoltan Hernyak
  • 989
  • 1
  • 14
  • 35
0
votes
1 answer

How to show the "save in" dialog for a sldocument in c #?

I have created a SLDocument, in which I have saved what I have obtained from an XML, but I want the user to save it in the location user wants, I have seen that the SLDocument only has the SaveAs option and I must specify the route, so I do not know…
AlexZ
  • 229
  • 1
  • 8
0
votes
1 answer

SpreadsheetLight C# - Load Excel Table by Name into DataTable

I am quite pleased with SpreadsheetLight. However I cannot help but think I've overlooked something. In Excel, you can "Format As Table" and then when the table is selected the "Table Tools - Design" tab appears. You can change Table Name which is…
C Sharp Conner
  • 378
  • 2
  • 11
0
votes
1 answer

SpreadsheetLight does not accept the timespan type

I'm using spreadsheetlight for exporting datas to excel. I have time values which defined string and i want to convert or parse to Timespan but spreadsheetlight does not accept Timespan value. How can i define Timespan with spreadsheetlight? Here is…
Uğur Can
  • 154
  • 2
  • 14