Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I generate the excel chart with out opening the excel instance? | Charts and Charting in Excel | |||
How do I number format the Data Table in an Excel Chart? | Charts and Charting in Excel | |||
Copy and paste Excel chart in Word -- font compresses | Charts and Charting in Excel | |||
tick mark labels | Charts and Charting in Excel | |||
Sumif Linking to Another Workbook error #VALUE! | Excel Discussion (Misc queries) |