TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Lijo Joseph
NA
1
5.3k
how to hide a row in excel using open xml?
Dec 17 2014 1:59 AM
I tried a lot for this. There are ways to read to a content from a hidden row but no ways to hide a row from an application. If anyone has a solution it will of great help if you share it.
Thanks in Advance
The code below is the try i did.
const string fileName = @"C:\Users\ljoseph\Documents\Book1.xlsx";
SpreadsheetDocument document = SpreadsheetDocument.Open(fileName, false);
WorkbookPart wbPart = document.WorkbookPart;
var sheets = wbPart.Workbook.Descendants<Sheet>();
var sheet = sheets.First();
var workSheet = ((WorksheetPart)wbPart.GetPartById(sheet.Id)).Worksheet;
var sheetData = workSheet.Elements<SheetData>().First();
var rows = sheetData.Elements<Row>().ToList();
var row = rows.Where(r => r.RowIndex.Value == 2).First();
row.Hidden = true;
document.Close();
Console.Read();
Reply
Answers (
2
)
raw Socket in C#
Regex 17122014