0

I have ID of WorksheetPart object obtained earlier from:

var id = document.WorkbookPart.GetIdOfPart(worksheetPart);

Now I'm trying to get object back by using LINQ. However, I'm unable to find ID property of the mentioned object:

var worksheetPart = document.WorkbookPart.WorksheetParts.Where(x => x.??? == id).First();

What property can I use instead of ??? placeholder?

Admir Tuzović
  • 10,997
  • 7
  • 35
  • 71
  • is `WorksheetParts` member of `WorksheetPart`? Couldn't find at http://msdn.microsoft.com/en-us/library/documentformat.openxml.packaging.worksheetpart_members.aspx – Ankush Oct 20 '12 at 20:52

1 Answers1

0

You are not finding ID property WorksheetPart class because it does not exist (see WorksheetPart Members).

The following code should give you what you need:

var TargetPart = document.WorkbookPart.GetPartByID(id);

Note: both GetPartByID(id) and GetIdOfPart(part) are members of WorkbookPart class

Julio Nobre
  • 4,196
  • 3
  • 46
  • 49