Macro: With Stop it works. Without Stop it doesn't.

  • Thread starter Thread starter Don Wiss
  • Start date Start date
D

Don Wiss

I'm having great difficulty debugging the initialization of a user form. As
part of the initialization it gets data from an Access database and gives
combo boxes their lists. Then at the end of the initialization it gives the
combo boxes values saved in spreadsheet cells. Two of these show up blank
(the list is fine). There is no code after assigning the value that could
trigger a change event. If I put a Stop anywhere in the initialization
macro, and then do nothing but continue, it works fine. So stopping and
stepping through is useless for debugging. It will always work. What's up?

Don <donwiss at panix.com>.
 
Hi Don,
So stopping and
stepping through is useless for debugging. It will always work.
What's up?

did you try to save the workbook under a new name (save as), then "open
and repair" (from Excel XP and later)? Try to create a new module/form
(whatsoever) in VBE and copy all your code there and delete the old
module. I remember having this problem cause by a corrupt Excel file.

But still, are you sure your connection to Access works correctly? Try
to pause your macro with application.wait (or maybe a dummy loopt with
do events). What happens, if you fill your list manually instead of the
access connection (like test1, test2... test10)?

regards

arno
 
did you try to save the workbook under a new name (save as), then "open
and repair" (from Excel XP and later)? Try to create a new module/form
(whatsoever) in VBE and copy all your code there and delete the old
module. I remember having this problem cause by a corrupt Excel file.

I've tried saving, deleting and importing the module. I have not tried
repairing the workbook. I then changed it from an Initialize routine to an
Activate routine. Then it worked. But when I clicked the done button the
two fields promptly cleared and it then fails on my required input edits.
But still, are you sure your connection to Access works correctly? Try
to pause your macro with application.wait (or maybe a dummy loopt with
do events).

I haven't tried a wait. I will.
What happens, if you fill your list manually instead of the
access connection (like test1, test2... test10)?

Since this is spreadsheet cell data I am putting in the fields I have no
reason to suspect Access. But I can try this.

Thanks for your suggestions. This is a low priority project, but I do plan
to spend some time on it today.

Don <donwiss at panix.com>.
 
Back
Top