How to insert a breakpoint and run the Workbook_Open event ??

  • Thread starter Thread starter Charles Jordan
  • Start date Start date
C

Charles Jordan

Rather an elementary question, but I am trying to step through my
Workbook_Open event and would like to insert a breakpoint in the code
and then step through it. But how can I do that when the breakpoint
vanishes when I first close the workbook ?

........ Anno domini again...

Charles
 
Put a Stop in the code

statement 1
Stop
statement 2

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Locate the cursor on the line of code where you want execution to stop &
press F9. (Another F9 will remove the stop). Then Press F8 to contiue one
line at a time.
 
You can put your cursor in the Workbook_Open procedure, and start it executing by
pressing F8 to step through or F5 to run through.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Jon Peltier said:
You can put your cursor in the Workbook_Open procedure, and start it executing by
pressing F8 to step through or F5 to run through.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Bob - thank you so much. I wasn't aware of the word "Stop" being
available in VBA - must have arrived since XL 95 where I was born. Not
often highlighted either in the books - try looking at (John
Walkenbach's "Power Programming in VBA" - my bible )where it seems not
to appear, in the index anyway...
 
Jon Peltier said:
You can put your cursor in the Workbook_Open procedure, and start it executing by
pressing F8 to step through or F5 to run through.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Jon - thank you - I knew about F8 and F5 but stupidly didn't try
stepping thru WorkBook_open . Discovered it for myself just after
posting to the NG, so much embarrassment. Bob's contribution is most
valuable actually too. Tks Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top