Today, I’ll show you how to add custom chart features or how to toggle features to show/hide data points on the chart. This technique helps users to control the hide/show settings of data points on the chart. I have demonstrated this technique in two ways :

  1. Without using VB Scripting or Macros
  2. Using VB Scripting or Macros.

Here is the VB Script Code :


Public Sub SetNumbersOnChart ()
         Set MyGraph = ActiveDocument.GetSheetObject(“CH02″)       
Set MyGraphProp = MyGraph.GetProperties       
Set MyExpsToggle = MyGraphProp.Expressions.Item(0).Item(0).Data.ExpressionVisual
IF MyExpsToggle.NumbersOnBars = False Then
MyExpsToggle.NumbersOnBars = True
MyExpsToggle.NumbersOnBars = False
End IF
MyGraph.SetProperties MyGraphProp
End Sub


I’ll demonstrate step-by-step process. Please contact me if you have any questions.

Just in case if you can’t watch the video from this site, you can use this link to watch from Youtube.

Thank you for watching. Happy learning.