Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Custom type chart | Excel Worksheet Functions | |||
Apply custom chart type - VBA | Charts and Charting in Excel | |||
Apply custom chart type - VBA | Excel Programming | |||
sharing a custom chart type | Charts and Charting in Excel | |||
Keep Pivot Table custom chart type | Charts and Charting in Excel |