Error message when running recorded Macro

makihussain

New Member
Joined
Oct 4, 2015
Messages
11
I got error message when running recorded Macro below in using solver at Bolded blue colour function


Sub Macro2()
'
' Macro2 Macro
'

'
SolverOk SetCell:="$L$4", MaxMinVal:=1, ValueOf:=0, ByChange:="$K$4", Engine:=1 _
, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$L$4", MaxMinVal:=1, ValueOf:=0, ByChange:="$K$4", Engine:=1 _
, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub

Annotation 2020-01-19 200326.jpg
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Macros recorded with Solver running in the background, can not run!
See this explanation from Jon Peltier or this one from Microsoft
 
Upvote 0
Solution
Thank you for the response and your great help.

I did follow the advice from Microsoft below by which I managed to establish the reference to "Solver"


Microsoft snap shot.PNG


Then I run the Macro below and it appeared it is working well passed the earlier obstruction

Macro running.jpg


Unfortunately the macro did not apply the last recorded step which is pressing the button "OK" as shown the snap shot below

Notification.jpg


So I would like to to know how to end the macro in order include pressing "OK" in the recorded Macro.

Thanks
 

Attachments

  • Microsoft snap shot.PNG
    Microsoft snap shot.PNG
    22.1 KB · Views: 2
  • Macro running.jpg
    Macro running.jpg
    30.2 KB · Views: 3
  • Notification.jpg
    Notification.jpg
    95.5 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,215,824
Messages
6,127,103
Members
449,358
Latest member
Snowinx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top