Share via

Excel 2013 VBA Macro Spinbutton code broken since December Update

Anonymous
2014-12-14T18:07:56+00:00

Hello All,

I have a complex WorkBook which uses many macros. One of them changes a chart's axis min/max via a SpinButton. This scripts works in Excel 2007/2010 and 2013 up until the recent December update. It doesn't work anymore. The spin button points to the following typical code on the same sheet as the button:

Option Explicit

Dim aY, bY As Single ' Y Max & Min

Private Sub SpinButton1_Change()

aY = Sgn(SpinButton1.Value) * (0.1 * Abs(SpinButton1.Value)) ^ 2.3 * 1.03

With ActiveSheet.ChartObjects("Chart_s1").Chart

.Axes(xlValue, xlSecondary).MaximumScale = aY

End With

End Sub

Since the last update clicking on the spin button has no effect. Also when you view the spin button's properties, the min/max values are missing (but are still there in Excel 2007).

Another macro which modifies chart axes aborts with Run time error 438 "Object doesn't support this property or method" with

ActiveSheet.SpinButton1.Value = 100    being the problem code.

It seems that the latest update has broken something in VBA? Can anyone shed some light on this please?

Thank you

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-12-15T12:27:33+00:00

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-12-15T12:16:11+00:00

    Hi,

    Just a heads up regarding a potential problem with Jan Karel Pieterse's workaround. It seems to fix my WB while working in Excel 2013. When I use the same file in Excel 2010 on my work PC VBA is once again broken (In the past it worked).

    There's a possibility that 2013 is messing up my .xlsb file.

    Thanks

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-12-14T18:41:44+00:00

    Thanks Mike, it did the trick! My Sunday is once again livable! :-)

    Was this answer helpful?

    0 comments No comments