#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro Debug

I'm not a big macro user but I thought I knew how to record and use
one. I went to tools/macros/record new macro and record five solver
calculations and named the marcro "a." Upon running the macro I get
"Compile Error: Sub or Function not defined." Here is the macro text
below. Excel recorded all my movements in setting up the macro so
what's the problem?

' Keyboard Shortcut: Ctrl+a
'
Solverok SetCell:="$L$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$L$12"
SolverSolve
Solverok SetCell:="$K$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$K$12"
SolverSolve
Solverok SetCell:="$J$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$J$12"
SolverSolve
Solverok SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$I$12"
SolverSolve
Solverok SetCell:="$H$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$H$12"
SolverSolve
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro Debug

Hi TC,

Try:
Go to Tools | References in the VBE (Alt F11 --TR)
This should open the reference list.
Scroll down until you find SOLVER and verify that it is checked.
Alt Q (to return to Excel)
---
Regards,
Norman

"tcnichols" wrote in message
m...
I'm not a big macro user but I thought I knew how to record and use
one. I went to tools/macros/record new macro and record five solver
calculations and named the marcro "a." Upon running the macro I get
"Compile Error: Sub or Function not defined." Here is the macro text
below. Excel recorded all my movements in setting up the macro so
what's the problem?

' Keyboard Shortcut: Ctrl+a
'
Solverok SetCell:="$L$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$L$12"
SolverSolve
Solverok SetCell:="$K$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$K$12"
SolverSolve
Solverok SetCell:="$J$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$J$12"
SolverSolve
Solverok SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$I$12"
SolverSolve
Solverok SetCell:="$H$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$H$12"
SolverSolve
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro Debug

Norman, thanks but References is grayed out. Ideas?

"Norman Jones" wrote in message ...
Hi TC,

Try:
Go to Tools | References in the VBE (Alt F11 --TR)
This should open the reference list.
Scroll down until you find SOLVER and verify that it is checked.
Alt Q (to return to Excel)
---
Regards,
Norman

"tcnichols" wrote in message
m...
I'm not a big macro user but I thought I knew how to record and use
one. I went to tools/macros/record new macro and record five solver
calculations and named the marcro "a." Upon running the macro I get
"Compile Error: Sub or Function not defined." Here is the macro text
below. Excel recorded all my movements in setting up the macro so
what's the problem?

' Keyboard Shortcut: Ctrl+a
'
Solverok SetCell:="$L$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$L$12"
SolverSolve
Solverok SetCell:="$K$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$K$12"
SolverSolve
Solverok SetCell:="$J$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$J$12"
SolverSolve
Solverok SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$I$12"
SolverSolve
Solverok SetCell:="$H$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$H$12"
SolverSolve
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro Debug

Norman, thanks but References is grayed out. Ideas?

"Norman Jones" wrote in message ...
Hi TC,

Try:
Go to Tools | References in the VBE (Alt F11 --TR)
This should open the reference list.
Scroll down until you find SOLVER and verify that it is checked.
Alt Q (to return to Excel)
---
Regards,
Norman

"tcnichols" wrote in message
m...
I'm not a big macro user but I thought I knew how to record and use
one. I went to tools/macros/record new macro and record five solver
calculations and named the marcro "a." Upon running the macro I get
"Compile Error: Sub or Function not defined." Here is the macro text
below. Excel recorded all my movements in setting up the macro so
what's the problem?

' Keyboard Shortcut: Ctrl+a
'
Solverok SetCell:="$L$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$L$12"
SolverSolve
Solverok SetCell:="$K$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$K$12"
SolverSolve
Solverok SetCell:="$J$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$J$12"
SolverSolve
Solverok SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$I$12"
SolverSolve
Solverok SetCell:="$H$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$H$12"
SolverSolve
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro Debug

Hi TC,

Norman, thanks but References is grayed out. Ideas?


This would happen if you were in break mode.
Try setting the Solver reference after pressing your macro reset button.


---
Regards,
Norman


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Debug Error Soroya1920 Excel Discussion (Misc queries) 1 June 26th 07 09:53 PM
Locking debug mode in a macro Megadrone Excel Worksheet Functions 1 November 30th 06 10:32 PM
How do I resolve debug error macro Excel 2000? At least, any lead Excel 2000 Macros debugger Excel Discussion (Misc queries) 5 October 25th 05 08:56 AM
No debug box mushy_peas[_33_] Excel Programming 2 April 23rd 04 12:20 AM
debug - [email protected] Excel Programming 1 March 6th 04 10:32 AM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"