Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Applying custom chart type


Hi

I have a pivot-chart that I want to have it formatted with my custom chart
type. I have the type created (and saved) but I'm struggiling with the code
responsible for reapplying the type whenever user selectes different item
from the drop-down lists on the chart. I used a recorded code that is as
follows:
Private Sub Chart_Calculate()
ApplyCustomChartType
End Sub

Private Sub ApplyCustomChartType()
Application.Calculation = xlCalculationManual
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Raport sprzedaży"
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
Application.Calculation = xlCalculationAutomatic
End Sub

Unfortunatelly the line ActiveChart.ApplyCustomType
ChartType:=xlUserDefined, TypeName:= "Raport sprzedaży" triggers the
Chart_Calculate event so the whole macro runs in endless loop.
How can fix this. Kind regards

Igor


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Applying custom chart type


Try
Application.EnableEvents =False
at the beginning of the sub and set it back to True at the end.

Regards,
Stefi


€žIgorM€ť ezt Ă*rta:

Hi

I have a pivot-chart that I want to have it formatted with my custom chart
type. I have the type created (and saved) but I'm struggiling with the code
responsible for reapplying the type whenever user selectes different item
from the drop-down lists on the chart. I used a recorded code that is as
follows:
Private Sub Chart_Calculate()
ApplyCustomChartType
End Sub

Private Sub ApplyCustomChartType()
Application.Calculation = xlCalculationManual
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Raport sprzedaÂży"
ActiveChart.Location Whe=xlLocationAsNewSheet
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
Application.Calculation = xlCalculationAutomatic
End Sub

Unfortunatelly the line ActiveChart.ApplyCustomType
ChartType:=xlUserDefined, TypeName:= "Raport sprzedaÂży" triggers the
Chart_Calculate event so the whole macro runs in endless loop.
How can fix this. Kind regards

Igor



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
Custom type chart Ask MS[_2_] Excel Worksheet Functions 2 June 25th 08 12:28 AM
Apply custom chart type - VBA Fredrik E. Nilsen Charts and Charting in Excel 5 April 20th 07 04:52 PM
Apply custom chart type - VBA Fredrik E. Nilsen Excel Programming 5 April 20th 07 04:52 PM
sharing a custom chart type Papa Jonah Charts and Charting in Excel 2 October 15th 05 02:17 PM
Keep Pivot Table custom chart type Jeff M Charts and Charting in Excel 3 April 8th 05 08:58 PM


All times are GMT +1. The time now is 07:26 PM.

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

About Us

"It's about Microsoft Excel"