View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default Excel Bug or Macro Problem?

Henry,

I am always going back and forth with the macros in break mode or when
stepping through code (with F8).

The only time when I have problems is when a cell is in the middle of being
edited (the cursor is
still somewhere in a cell).

One of the things that might be causing the problem is that all the cells
are protected and can't be selected.

The only way to help isolate the prolem is:
1. Put Option Explicit at the top of all modules
2. Compile the project
3. Down load a copy of Code Cleaner and "fix" your code
4. Carefully step through the code and monitor everything that happens.
Make sure you exercise
all the possibities within the code.
5. Make sure your code is as simplistic as possible (remove selections,
replace complicated
copy/paste code with simpler code, etc)
6. ????? (ask and ask again) (and post some or all of your code; mark
where you think the
problem is coming from)....


--
steveB

Remove "AYN" from email to respond
"Henry" wrote in message
...
Don,

When you want to change back to the workbook from the VBE, you have to
deactivate any running macro.
To do this, click on the little black square (Reset) button on the VBA
toolbar.

A breakpoint in your code only pauses the macro but doesn't deactivate it.
The macro is still active, waiting for you to hit F8 to step forward or
Run to run to the next breakpoint or the end.

If you want to see the sheet and run the macro at the same time, resize
the windows so both are visible.
You still won't be able to do anything on the sheet until the macro has
been deactivated.


Henry


"Don Wiss" wrote in message
...
Every so often I have a problem where the macro code clearly runs, but
the
action that it is supposed to do doesn't happen. Usually I just abandon
what I want to do and do something else. In this case I don't want to
give
in. I have a cell change event on a data validation drop down list. It
then
calls another macro. Since the sheet is protected, I issue a Protect with
UserInterfaceOnly:=True. I am then either hiding or unhiding some rows on
that sheet. But the macro runs and the rows don't change. This problem
has
one unique characteristic that I've seen before. If I put a stop in the
macro, Alt-F11 won't take me to the workbook. I can use the task bar to
get
to it, but then a click anyplace on the worksheet gets a dull thud noise.
No menu works. Can't change sheets. All one can do it to use the task bar
and return to Visual Basic. What gives?

Thanks, Don <www.donwiss.com (e-mail link at home page bottom).