In VS2005 B2, how can I get the amount of charts on a sheet and set the title for each in a loop?
T-Bone |
| tbonejo |
There is a Charts collection which exists.
To get the number of chart on a sheet, try to get this charts collection and use the Count property of this collections
HTH.
Bye
Blog on WPF / C# / .NET: http://blogs.developpeur.org/tom | Site: http://morpheus.developpez.com |
| LEBRUN Thomas |
If you add the following code to your ThisWorkbook_Startup event you'll see it lists the number of sheets and then their names:
MessageBox.Show(this.Sheets.Count.ToString()); foreach (Excel.Worksheet s in this.Sheets) { MessageBox.Show(s.Name); }
Ade
Development Lead, Microsoft VSTO |
| Ade Miller - MSFT |
Yes, but if I'm rigth, he wants to display the number of charts on a sheet, not the number of sheets.
So maybe he could try something like this:
| |
MessageBox.Show(this.Sheets.Charts.Count.ToString());
|
(Notice that I haven't test this code)
HTH.
Bye.
Blog on WPF / C# / .NET: http://blogs.developpeur.org/tom | Site: http://morpheus.developpez.com |
| LEBRUN Thomas |
I did figure it out, however, I am assuming with VS2005 B2, ONLY Office 2003 is supported thru the .net and anything below that is a com ref? Or else Im not doing the setup correctly.
T-Bone |
| tbonejo |
With Office 2003, Excel, Word and Outlook are supported in .NET InfoPath, PowerPoint and Access are COM automation
Blog on WPF / C# / .NET: http://blogs.developpeur.org/tom | Site: http://morpheus.developpez.com |
| LEBRUN Thomas |