Share via

Help Getting Macro Button Work

Anonymous
2022-06-21T22:19:01+00:00

I just created a button to launch a Macro that runs the solver. But when I click it, it doesn't run. I see it click, but no action occurs. The VBA code behind the macro is very simple:

Sub SolveSurfaceTemp()

'

' SolveSurfaceTemp Macro

' Solves for Windbox Surface Temp (B7) after Windbox Temperature (B4), Ambient Temperature (B5) and Insulation Thickness (B9) have been input.

'

' Keyboard Shortcut: Ctrl+t

'

SolverOk SetCell:="$B$11", MaxMinVal:=3, ValueOf:=0, ByChange:="$B$7", Engine:= \_ 

    1, EngineDesc:="GRG Nonlinear" 

SolverOk SetCell:="$B$11", MaxMinVal:=3, ValueOf:=0, ByChange:="$B$7", Engine:= \_ 

    1, EngineDesc:="GRG Nonlinear" 

SolverSolve 

End Sub

I've confirmed that the macro works when I run it manually. I've enabled everything I know how, but I still can't launch the Solver from this button. Does anyone have a clue what might be wrong?

Microsoft 365 and Office | Excel | For business | 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

Answer accepted by question author

Anonymous
2022-06-21T22:33:43+00:00

Re: "the macro works when I run it manually"

You may be using an ActiveX control, which takes some additional work to make it function.

Try using a Forms Control button

.

'---

Nothing Left to Lose

https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU

(free excel programs)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-06-22T02:57:02+00:00

    Yup! That solved the problem! Thx.

    You are welcome.

    '---

    Nothing Left to Lose

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-06-21T23:16:16+00:00

    Yup! That solved the problem! Thx.

    Was this answer helpful?

    0 comments No comments