Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Step Into Macro when file opens

I have a Command Button on my Standard Menu. It has an Assigned Macro and
the macro is not functioning the way I want it to. How can I tell it to Step
Into when it first opens the file when I click the Button on the Menu. That
is the only way I will be able to tell what is going on because after that
other variables have been set so I cannot just go run the macro after the
file has opened.

Thank you,

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Step Into Macro when file opens

Go into the macro and put a breakpoint on the first active statement, then
your code will stop running at the breakpoint and you can use the F8 key to
single step your way through the code afterwards. You can put a breakpoint
on any active statement by clicking the vertical gray bar to the left of
your code... a red dot will appear and the statement will be highlighted in
red to signal the breakpoint for that line.

--
Rick (MVP - Excel)


"Steven" wrote in message
...
I have a Command Button on my Standard Menu. It has an Assigned Macro and
the macro is not functioning the way I want it to. How can I tell it to
Step
Into when it first opens the file when I click the Button on the Menu.
That
is the only way I will be able to tell what is going on because after that
other variables have been set so I cannot just go run the macro after the
file has opened.

Thank you,

Steven


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Step Into Macro when file opens

Rick,

Thank you for the response. Question: But I cannot put a breakpoint and
then close the file and then and have it break at that point, correct? ie If
I close the file it will remove the breakpoint. How can I keep the
breakpoint even when I close the file so when I open the file it will stop on
that breakpoint when the file is first opened. Note: I am opening the file
by a command button on the menu bar with an assigned macro in the file. That
macro is where I want to start stepping into the macro when the file first
opens.

Thanks,

Steven

"Rick Rothstein" wrote:

Go into the macro and put a breakpoint on the first active statement, then
your code will stop running at the breakpoint and you can use the F8 key to
single step your way through the code afterwards. You can put a breakpoint
on any active statement by clicking the vertical gray bar to the left of
your code... a red dot will appear and the statement will be highlighted in
red to signal the breakpoint for that line.

--
Rick (MVP - Excel)


"Steven" wrote in message
...
I have a Command Button on my Standard Menu. It has an Assigned Macro and
the macro is not functioning the way I want it to. How can I tell it to
Step
Into when it first opens the file when I click the Button on the Menu.
That
is the only way I will be able to tell what is going on because after that
other variables have been set so I cannot just go run the macro after the
file has opened.

Thank you,

Steven



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Step Into Macro when file opens

Good point. Then you should be able to insert a Stop statement before the
first active statement you want to break at. The Stop statement causes the
same kind of break that the "red dot" method does and should be able to be
saved with the macro.

--
Rick (MVP - Excel)


"Steven" wrote in message
...
Rick,

Thank you for the response. Question: But I cannot put a breakpoint and
then close the file and then and have it break at that point, correct? ie
If
I close the file it will remove the breakpoint. How can I keep the
breakpoint even when I close the file so when I open the file it will stop
on
that breakpoint when the file is first opened. Note: I am opening the
file
by a command button on the menu bar with an assigned macro in the file.
That
macro is where I want to start stepping into the macro when the file first
opens.

Thanks,

Steven

"Rick Rothstein" wrote:

Go into the macro and put a breakpoint on the first active statement,
then
your code will stop running at the breakpoint and you can use the F8 key
to
single step your way through the code afterwards. You can put a
breakpoint
on any active statement by clicking the vertical gray bar to the left of
your code... a red dot will appear and the statement will be highlighted
in
red to signal the breakpoint for that line.

--
Rick (MVP - Excel)


"Steven" wrote in message
...
I have a Command Button on my Standard Menu. It has an Assigned Macro
and
the macro is not functioning the way I want it to. How can I tell it
to
Step
Into when it first opens the file when I click the Button on the Menu.
That
is the only way I will be able to tell what is going on because after
that
other variables have been set so I cannot just go run the macro after
the
file has opened.

Thank you,

Steven




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
File opens another file runs macro and closes Steven Excel Programming 2 July 3rd 08 04:45 AM
run macro step by step. excel 2003 PBM[_3_] Excel Programming 2 November 19th 05 02:19 PM
running macro step by step different from normal run?? Rinze Smit Excel Programming 10 July 26th 05 03:35 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM
how to get a macro to run when the file opens Mary[_6_] Excel Programming 3 September 29th 04 07:52 PM


All times are GMT +1. The time now is 07:46 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"