Can you Quickly Get the Worksheet Names?
See original GitHub issueDo you want to request a feature or report a bug?
- [] Bug
- Feature
Version of ClosedXML
0.94.2
What is the current behavior?
When I want to get all names of the WorkSheets I create a new XLWorkbook
and then iterate over the worksheets to get their names. My Excel File is rather big and it takes some time to create a XLWorkbook
just for reading the sheetnames. I wonder if there is a way to just read the sheetnames without loading the whole content for better performance.
What is the expected behavior or new feature?
Get all sheetnames without reading all of their content (quick access).
Reproducibility
Code to reproduce problem:
public void Main()
{
var names = new List<string>();
// Takes some time to load just to get sheet names...
using (var wb = new XLWorkbook("File.xlsx"))
{
foreach (var sheet in wb.Worksheets)
{
names.Add(sheet.Name);
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
3 Quick Ways to Get a List of All Worksheet Names in an ...
Method 1: Get List Manually ... Next, press “Ctrl + C” to copy the name. ... Then, press “Ctrl + V” to paste...
Read more >How To Generate A List Of Sheet Names From A Workbook ...
How To Generate A List Of Sheet Names From A Workbook Without VBA · Go to the Formulas tab. · Press the Define...
Read more >How to Get All Worksheet Names in Excel (2 Easy Ways)
Getting Sheet Names in Excel Using Formula · Go to the Formulas tab and click on the Name Manager in the Defined Names...
Read more >How to create a list of all worksheet names from a workbook?
Get a list of all worksheet names from a workbook with a useful feature · 1. Click Kutools Plus > Worksheet > Create...
Read more >Microsoft Excel: Create an automated list of worksheet names
A. Yes, you can create a list of your Excel workbook's worksheet names as follows. From the Formulas tab, select Defined Names, Define...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Only because my day job’s project is running unit tests for 15min and I’m idling while monitoring my Gmail inbox 😉
Thanks you have pointed me towards the right direction. I have used OpenXML in order to acchieve my goal (takes 200ms compared to loading the whole workbook with closedXML in 4s). Here is the code for for anyone who is interested: