Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all 1877 articles
Browse latest View live

Source code checked in, #80652

$
0
0
Fix array formulas for single cells

New Post: autofit row height after setting height value

$
0
0
I don't think that can be done. The reason you can do it in Excel is because it's row autofit works with text wrap. ClosedXML's adjust to contents only takes into account the number of lines in cell (in your case 1).

Do you know how to do it in Excel without using autofit?

New Post: autofit row height after setting height value

New Post: autofit row height after setting height value

$
0
0
Not for a single row. In your case I suggest you set the row height only for the rows you want them to have it and leave the rest with their default.

New Post: autofit row height after setting height value

$
0
0
hmm.. aite.
I have one last question that is not related to height, but data validation.
I have two worksheets.
Worksheet#1 have two cells, let's say they are A1 and B1.
A1 is a datavalidation from a list from a range from worksheet#2.
The workbook contains named ranges with a scope of the entire workbook, and the names are the possible values of the datavalidation of A1.
Then I want Cell A2 of Worksheet#1 to have a data validation of a list depending on the value of Cell A1, which can be done in excel with
=INDIRECT($A1)
pretty much A2 is getting the value of A1, and creating a dropdown menu which contains the values of ranges that have the name of the value of A1.
How can this be implemented?
I just need to know how that "=INDIRECT()" part can be done with ClosedXML.

New Post: autofit row height after setting height value

$
0
0
Indirect is not implemented. Did you check the data validation and auto filters pages in the documentation?

New Post: autofit row height after setting height value

$
0
0
Ah, bummer :/
Yeah, I read through the documentation and was just hoping there was a way around it.
Just because the cells do have formulas
cellWithFormulaA1.FormulaA1 = "=A2+$B$2";
I was hoping there was something similar like
Cell.DataValidation.List("=INDIRECT($A1)");
So currently no dependent drop down feature I guess? :(

New Post: autofit row height after setting height value

$
0
0
I guess I don't know what you mean. You can have a dropdown based on values from a set of cells. It doesn't matter if those cells get their value from formulas.

Created Unassigned: Cannot remove OutlineLevel [9238]

$
0
0
I have a grouping (outline) in the original sheet being loaded and try to remove that grouping, but the grouping remains.

This works fine when the OutLine is added programatically and then removed programatically (via ungroup()).


var wb = new XLWorkbook("C:/Temp/OutlineInput.xlsx");
var ws = wb.Worksheets.First();
var outlinedRows = new List<IXLRow>();
ws.RowsUsed().ForEach(r => {
if (r.OutlineLevel > 0)
{
r.Ungroup(true);
outlinedRows.Add(r);
}
});

When changing XLWorkbook_Save.cs to always save the OutlineLevel to the native row object it seems to work.

// if (thisRow.OutlineLevel > 0)
row.OutlineLevel = (byte)thisRow.OutlineLevel;

Created Unassigned: Creating a new macro-enabled Excel spreadsheet does not work [9245]

$
0
0
I need to create a new XSLM spreadsheet document.

I am using this code. The resulting file cannot be opened by Excel 2010 and it is actually an XLSX file. I am able to open when I change its extension to XLSX.

```
var workbook = new XLWorkbook();
var worksheet = workbook.Worksheets.Add("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
workbook.SaveAs("HelloWorld.xlsm");
```

New Post: Does ClosedXML/Open XML SDK work with xlsm files?

$
0
0
I need to create new XLSM file and modify existing file. I don't need to add new VBA code.

I've used the sample code and the resulting file is actually an XLSX file.

I've opened an issue:
https://closedxml.codeplex.com/workitem/9245

Is there anything I am doing wrong?
var workbook = new XLWorkbook();
var worksheet = workbook.Worksheets.Add("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
workbook.SaveAs("HelloWorld.xlsm");

New Post: Issue enumerating Pivot tables in xlsx

$
0
0
Hi.
Anyone has issues accessing Pivot tables?
  .WorkSheet.PivotTables.Count()  returns 0 ..
... yet, when I access the xlsx via OpenXML, i can see the Pivot...

using ClosedXML ver 0.69.1.0 on Framework 4.0 ... please advise, thanks....

Commented Unassigned: Creating a new macro-enabled Excel spreadsheet does not work [9245]

$
0
0
I need to create a new XSLM spreadsheet document.

I am using this code. The resulting file cannot be opened by Excel 2010 and it is actually an XLSX file. I am able to open when I change its extension to XLSX.

```
var workbook = new XLWorkbook();
var worksheet = workbook.Worksheets.Add("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
workbook.SaveAs("HelloWorld.xlsm");
```
Comments: ** Comment from web user: borismod **

Patch is attached

New Post: Run macro whit closedxml

$
0
0
Hi,

I can't find the way to run a macro of excel without using the interop library.

Can anyone help?

Thanks in advance

Jorge

New Comment on "Using Hyperlinks"

$
0
0
External links to paths/filenames containing whitespaces don't work as expected. Excel (200/) will open with an error and removes the hyperlinks. Converting the whitespaces to %20 (via System.Uri) solves the problem. Maybe this should be changed in the closedxml.dll?

New Comment on "Using Hyperlinks"

$
0
0
External links to relative paths/filenames containing whitespaces don't work as expected. Excel (200/) will open with an error and removes the hyperlinks. Converting the whitespaces to %20 (via System.Uri) solves the problem. Maybe this should be changed in the closedxml.dll?

New Post: Does ClosedXML/Open XML SDK work with xlsm files?

New Post: null exception when opening empty excel

Created Unassigned: Bug - Range.CopyTo issue with partly overlapping source and target range [9247]

$
0
0
When a source range spanning multiple rows and columns is copied to a target range which partly overlaps the source range, some resulting cells are blanked out and borders are not formatted.

The issue does not seem to occur when source and target ranges do not overlap.
The issue does not seem to occur when the range spans multiple columns but only one row, at least not for my data range.

Updated Wiki: Home

$
0
0

Project Description

ClosedXML makes it easier for developers to create Excel 2007/2010 files. It provides a nice object oriented way to manipulate the files (similar to VBA) without dealing with the hassles of XML Documents. It can be used by any .NET language like C# and Visual Basic (VB).

Q: Dude, where have you been?

A: I've been making a survey app called Conspek. It's now open to the public. My hope is that it will be able to pay the bills and allow me to keep working on ClosedXML.

Q: Why a survey tool?

A: The same reason I created ClosedXML, I wasn't happy with my options. A while back I had to create a survey but all online survey apps were fiendishly hard, all so clunky, and with a million options in my face (that I would never use). So I created my own survey tool with the goal of making the experience as easy and simple as possible. Try it out and give me some feedback ^_^


What can you do with this?

ClosedXML allows you to create Excel 2007/2010 files without the Excel application. The typical example is creating Excel reports on a web server.

If you've ever used the Microsoft Open XML Format SDK you know just how much code you have to write to get the same results as the following 4 lines of code.

            var workbook = new XLWorkbook();
            var worksheet = workbook.Worksheets.Add("Sample Sheet");
            worksheet.Cell("A1").Value = "Hello World!";
            workbook.SaveAs("HelloWorld.xlsx");



Something more elaborate:

The Documentation page has an example of how to create the following table (Showcase) as well as many other examples:

Showcase.jpg

 

Viewing all 1877 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>