title: Making axis title in Excel chart with VBA
body: <p>I create an excel chart with VBA and then format the axis titles and fonts' size. The following code works well for the Horizontal axis</p>
  
  <pre><code>cht.SetElement msoElementPrimaryCategoryAxisTitleAdjacentToAxis
  cht.Axes(xlCategory, xlPrimary).AxisTitle.Text = "Factor of Safety"
  cht.Axes(xlCategory, xlPrimary).AxisTitle.Format.TextFrame2.TextRange.Font.Size = 15
  </code></pre>
  
  <p>However, the similar code for the Vertical axis</p>
  
  <pre><code>cht.SetElement msoElementPrimaryValueAxisTitleAdjacentToAxis
  cht.Axes(xlValue, xlPrimary).AxisTitle.Text = "Depth [mCD]"
  cht.Axes(xlValue, xlPrimary).AxisTitle.Format.TextFrame2.TextRange.Font.Size = 15
  </code></pre>
  
  <p>leads to the error 424 "Object required". Could you please tell me what happened ?</p>