How can I get the specific column in excel worksheet using DocumentFormat.OpenXml C#?
问题 As the title, I would like to get a specific column in excel worksheet using OpenXML in C# for setting hidden property. Like that: var columns = worksheet.GetFirstChild<Columns>(); var column = columns.FirstOrDefault(c=>c.ColumnIndex == 4); column.Hidden = true; The code above is just a sample for my idea. Is there any way for solving my problem? 回答1: per: https://docs.microsoft.com/en-us/office/open-xml/how-to-get-a-column-heading-in-a-spreadsheet , workSheetPart.Worksheet.Descendants() in