View Single Post
  #3   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Charles,

You could use a flag. In module ThisWorkbook:

Private Sub Workbook_Open()
If MsgBox("Do you want to run the macros?", vbYesNo, "Hey") = vbYes Then
MacRun = True
End Sub

Now in your macros you can test this switch to determine whether to do stuff
or not

In a general module

Public MacRun as Boolean ' This line must be before any subs,
' (and only in one module).

Sub whatever()
If not MacRun then exit sub
..
' your macro code
..
End sub
--
Earl Kiosterud
www.smokeylake.com

"Charles" wrote in message
...
How do I control the execution of the VBA Code in a spread sheet when I
first
load the workbook.
I would like a dialog box to ask if I want to execute the code or not
whenI
open the workbook?
Can any one suggest a way to do that???
--
CharlesM