Questions tagged [epplus-4]

EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).

EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).

http://epplus.codeplex.com/

189 questions
43
votes
8 answers

EPPlus - Read Excel Table

Using EPPlus, I want to read an excel table, then store all the contents from each column into its corresponding List. I want it to recognize the table's heading and categorize the contents based on that. For example, if my excel table is as…
Liren Yeo
  • 3,215
  • 2
  • 20
  • 41
32
votes
1 answer

Why is EPPlus telling me that I "Can't set color when patterntype is not set" when I have set PatternType?

I've got this code to try to style a header row: worksheet.Cells["A32:D32"].Style.Font.Name = "Georgia"; worksheet.Cells["A32:D32"].Style.Font.Bold = true; worksheet.Cells["A32:D32"].Style.Font.Size =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
30
votes
2 answers

How can I assign a color to a font in EPPlus?

I can set the background color of a cell or range of cells like so: rowRngprogramParamsRange.Style.Fill.PatternType = ExcelFillStyle.Solid; rowRngprogramParamsRange.Style.Fill.BackgroundColor.SetColor(Color.DarkRed); I have not been able to set the…
19
votes
1 answer

How can I filter columns (rather than rows) in EPPlus?

Filtering rows in a particular column is as easy as pie in EPPlus: private ExcelWorksheet prodUsageWorksheet; . . . prodUsageWorksheet.Cells["A6:A6"].AutoFilter = true; This allows me to filter the rows in column A: I also need to filter certain…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
13
votes
1 answer

EPplus To Insert X Number of Blank Rows

I have an instance where if a cell value is between 15 and 25 then I need to insert 10 blank rows, if the cell value is > 30 I need to insert 25 blank rows Rather than simply typing the same syntax repeatedly and adding 1 row at a time, does EPPLUS…
Smith Stanley
  • 461
  • 1
  • 8
  • 25
13
votes
7 answers

Worksheet position out of range. Connection Closed. When using EPPLUS

I am trying to open an XLSX file as a template (I have even used a blank XLSX file), using EPPLUS 4.0.3. If I do not open the template file (blank or the real one) and just create a new workbook and create a sheet, it works fine. OR if I open the…
user-44651
  • 3,924
  • 6
  • 41
  • 87
12
votes
1 answer

Is there a way to get 'named' cells using EPPlus?

I have an Excel file that I am populating programmatically with EPPlus. I have tried the following: // provides access to named ranges, does not appear to work with single cells worksheet.Names["namedCell1"].Value = "abc123"; // provides access to…
gnobes
  • 133
  • 1
  • 9
9
votes
2 answers

Apply partial styling to text in excel cell using EPpplus

How do I apply partial styling to contents of a cell? For example, if a cell contains the following text "Hello World". I want to make the word "Hello" bold while leaving the word "World" unchanged. I've applied styling to the entire cell just…
user2602844
  • 133
  • 1
  • 6
8
votes
2 answers

Access Protected Excel File with ExcelDataReader and Epplus

title pretty much says it all. Looking for a way to access a password protected excel file with ExcelDataReader and Epplus, can't find a proper answer. If using ExcelDataReader, my code looks like excelStream =…
Mike H
  • 387
  • 9
  • 25
8
votes
1 answer

Excel & EPPlus .NET library: Advanced DropDown list validation

In Epplus, when we create a DropDown list for some cells in excel file, then user put a value which is not part of the list, the cell show a message says: value must match one of the listed items. Instead of this message, Is it possible to prevent…
I3i0
  • 1,191
  • 2
  • 12
  • 25
5
votes
3 answers

EPPlus set default worksheet

I am using EPPlus v4.1 to generate an excel file in C#. Is there a way to set a specific worksheet as the default worksheet? (when the user is opening the exported file, that sheet should be shown) I could not find a method or property on…
sebastian.roibu
  • 2,579
  • 7
  • 37
  • 59
5
votes
1 answer

EPPLUS To Clear Contents of A Range Of Cells

I want to use EPPLUS to clear a range of cells. I tried the syntax below, but it gives me an error of object reference not set to an instance of an object What would be the proper way to clear the contents of cells A24:C36 with…
5
votes
3 answers

update existing workbook using epplus C#

I am trying to add new worksheet into existing workbook, code runs fine without any error. But changes are not being updated to the excel file. Here is my code string path = "C:\\TestFileSave\\ABC.xlsx"; FileInfo filePath = new FileInfo(path); if…
Ravi Khatana
  • 53
  • 1
  • 1
  • 6
4
votes
2 answers

Copy Formula To Multiple Cells Using EPPlus

I am using Epplus and am using it to input a formula into cells K1 and K2 and this code works great for that. However, I need to "drag" the formulas from K1 and K2 to the right until I reach the last column with data. My current code…
4
votes
1 answer

Reading shapes and textboxes in EPPlus 4.5.3

I am trying to read an excel file using EPPlus version 4.5.3, which I am able to do using the code below: FileInfo existingFile = new FileInfo(FilePath); using (ExcelPackage package = new ExcelPackage(existingFile)) { //get the first worksheet…
1
2 3
12 13