Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 27
Default Excel Chart properties from VB.Net 2005

Hi,

I am trying to get a number of properties from a Chart in Excel from my
VB.Net application.

I can get the Chart Type and Chart Title, but need the following properties:

1) Check if the Data Labels show Percentage

2) Find out if the Chart is inserted as a New Sheet, and if so, what it is
called (Name)

3) Check if the Title has a Shadow Border around it

4) Find out the Series (Source Data) used for the Chart

Dim objExcelApp As Excel.Application = Nothing

Dim objWorkBook As Excel.Workbook = Nothing

objExcelApp = New Excel.Application()

objWorkBook = objExcelApp.Workbooks.Open(strFolder & "\ExcelData.xls")

Dim objChart As Excel.Chart = objWorkBook.Charts(1)

With objChart

MessageBox.Show(objChart.ChartType.ToString)

MessageBox.Show(objChart.ChartTitle.Text)

'Check if Data Labels show Percentage

'Get Source Data?

'Find out if Chart location is New Sheet, and if so, name of the Chart

'Check if Title has Shadow Border

End With

I have spent so many hours trying and searching for info, but no luck.

Any help would be much appreciated.

Thanks in advance,

Grant.

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Excel Chart properties from VB.Net 2005

Open up Excel, make a chart, then record a macro while you apply these
various formats to elements in the chart. This gives you the VBA syntax for
these properties, and I'll leave it up to you to determine how VB.Net
renders this syntax.

For the source data, Excel does not expose this to VBA (or even to the UI if
the region is "too complicated to display"). You will have to parse the
series formulas of each series and reconstruct this range. John Walkenbach
has a class module that does the hard work for you:

http://www.j-walk.com/ss/excel/tips/tip83.htm

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Grant" wrote in message
...
Hi,

I am trying to get a number of properties from a Chart in Excel from my
VB.Net application.

I can get the Chart Type and Chart Title, but need the following
properties:

1) Check if the Data Labels show Percentage

2) Find out if the Chart is inserted as a New Sheet, and if so, what it is
called (Name)

3) Check if the Title has a Shadow Border around it

4) Find out the Series (Source Data) used for the Chart

Dim objExcelApp As Excel.Application = Nothing

Dim objWorkBook As Excel.Workbook = Nothing

objExcelApp = New Excel.Application()

objWorkBook = objExcelApp.Workbooks.Open(strFolder & "\ExcelData.xls")

Dim objChart As Excel.Chart = objWorkBook.Charts(1)

With objChart

MessageBox.Show(objChart.ChartType.ToString)

MessageBox.Show(objChart.ChartTitle.Text)

'Check if Data Labels show Percentage

'Get Source Data?

'Find out if Chart location is New Sheet, and if so, name of the Chart

'Check if Title has Shadow Border

End With

I have spent so many hours trying and searching for info, but no luck.

Any help would be much appreciated.

Thanks in advance,

Grant.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I generate the excel chart with out opening the excel instance? ramkumar_cpt Charts and Charting in Excel 1 March 1st 06 06:22 PM
How do I number format the Data Table in an Excel Chart? Chartsmalm Charts and Charting in Excel 3 February 16th 06 03:06 PM
Copy and paste Excel chart in Word -- font compresses ScooterGirl Charts and Charting in Excel 3 February 10th 06 04:25 AM
tick mark labels Debrane Charts and Charting in Excel 9 July 19th 05 03:53 AM
Sumif Linking to Another Workbook error #VALUE! Tunde Excel Discussion (Misc queries) 16 March 4th 05 04:02 AM


All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"