我正在编写一个宏以生成图形,并使用宏记录器来执行此操作。当到达我在其中放置了轴的轴的那一部分时,会出现“运行时错误424对象需要”错误。我想念什么?
我曾经写过这个宏一次,它只放入了一个轴标题中。当我尝试添加第二个时,我不断出错并放弃并决定重新记录。现在我无法在图表上找到任何一个。
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "# Samples"
Selection.Format.TextFrame2.TextRange.Characters.Text = "# Samples"
With Selection.Format.TextFrame2.TextRange.Characters(1,
9).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With