To see the problem that I encounter you have to work with Excel workbook, that have something special in it. So, having Excel 2007/2010, create any chart on any worksheet. Now click right mouse button on created chart and select "Move Chart" menu item. Now you have two options here: "Object in" and "New sheet". Select the "New sheet" option and give some name to your new sheet. For example name it "AAA". As a result you now have new tab with your chart, the name of the tab is "AAA", all looks right and correct.
Now to my problem :) Open this document using Microsoft.Office.Interop.Excel.dll and try to find Worksheet object with name "AAA". You won't find it. And the number of existing worksheets is equal to the number of worksheets in Excel before you did this magic "Move Chart" action. So, I assume that MS have some "make it a tab" attribute, that can be set for chart object. So that it appears like worksheet in Excel, but it is not. My question is how can I get the collection of those tab-objects in interop objects model?
Why I need this? If it matters - I have some application that creates docx reports based on docx template. The template can contain different commands that tells to take some objects from another files. Those files might be an Excel files, and those objects might be a chart. The template is edited by user once, and then used many times. The user usually will open the Excel file and look through it to identify what he should write in those commands. And it is pretty understandable that if he sees some chart on tab with "AAA" name, he will write the command that asks to take the chart from "AAA" worksheet... and my program fails here, since no such worksheet exists. So, iterating through "tab-like" object collection definitely would help me here.
Best regards, Artem