![]() |
Empty Pivot Chart
Is there a quick and easy way of programmatically checking to see if an OLAP
Pivot table or associated chart has no data in it Thanks in advance, Tony |
Empty Pivot Chart
I use this when printing pivot charts:
If ActiveChart.SeriesCollection(1).Points.Count = "" Then 'do nothing Else ActiveWindow.SelectedSheets.PrintOut End If Tony wrote: Is there a quick and easy way of programmatically checking to see if an OLAP Pivot table or associated chart has no data in it Thanks in advance, Tony -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Empty Pivot Chart
Thank you for that. Unfortunately this doesnt work for me.
I think it becasue there are Dimensions and Series on the chart but my current selections have filtered out all the data e.g. selecting Saturday from a DOW dimension when data only exists for Mon - Friday. I need some indication that my selection criteria does not return any results "Debra Dalgleish" wrote in message ... I use this when printing pivot charts: If ActiveChart.SeriesCollection(1).Points.Count = "" Then 'do nothing Else ActiveWindow.SelectedSheets.PrintOut End If Tony wrote: Is there a quick and easy way of programmatically checking to see if an OLAP Pivot table or associated chart has no data in it Thanks in advance, Tony -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Empty Pivot Chart
Perhaps you could use the GetPivotData function on the worksheet, to
check the total in one of the measures. For example, in a cell named DataCheck: =GETPIVOTDATA("[Measures].[Sum Of Total ]",$A$5) Then, check that cell in the code: Dim rngCheckData As Range Set rngCheckData = ActiveWorkbook.Names("DataCheck").RefersToRange If IsError(rngCheckData.Value) Then MsgBox "No data" Else Sheets("Chart1").PrintPreview End If Tony wrote: Thank you for that. Unfortunately this doesnt work for me. I think it becasue there are Dimensions and Series on the chart but my current selections have filtered out all the data e.g. selecting Saturday from a DOW dimension when data only exists for Mon - Friday. I need some indication that my selection criteria does not return any results "Debra Dalgleish" wrote in message ... I use this when printing pivot charts: If ActiveChart.SeriesCollection(1).Points.Count = "" Then 'do nothing Else ActiveWindow.SelectedSheets.PrintOut End If Tony wrote: Is there a quick and easy way of programmatically checking to see if an OLAP Pivot table or associated chart has no data in it Thanks in advance, Tony -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
All times are GMT +1. The time now is 12:03 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com