Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

IDENTIFY CHARTSHEETS OPEN XML SDK

$
0
0

I am looking for a way to identify if an Excel sheet is a WorkSheet or a ChartSheet, in the below when it executes the last line, it will throw an exception if the sheet is a ChartSheet. Is there a way to identify the type of sheet using the Sheet.Id?

            Using SDocument As SpreadsheetDocument = SpreadsheetDocument.Open(filename, False)
                Dim workbookPart As WorkbookPart = SDocument.WorkbookPart
                workbookPart.Workbook.Descendants(Of Sheet)()
                For Each Sheet As Sheet In SDocument.WorkbookPart.Workbook.Sheets
                    Try
                        Dim sID As String = Sheet.Id
                        Console.WriteLine(sID)
                        Dim part As WorksheetPart = workbookPart.GetPartById(sID)

                        

Viewing all articles
Browse latest Browse all 1288


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