View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
[email protected] HammerJoe@gmail.com is offline
external usenet poster
 
Posts: 126
Default DOEVENT stops working??

Hi Jaf,

Didnt take me long to figure out why I needed to have a DoEvent in a
loop. :)

I need the the button to be pressed by the user.

I have two report sheets that need to be emailed, one is weekly and
the other is monthly.

At the beginning of every week the AUTO_OPEN sub on module1 calls
this
sub and it has to wait until the button is clicked before continuing
because it will reset the report.

I also have placed a button on the weekly report itself that also
calls this sub as well in case the user wants to email the report or
print it. (In this case your sugestion works fine because theres
nothing else to be done.)

And finally at the begining of every month the sub is called for the
monthly report and again it has to wait for user confirmation before
continuing and reset the monthly report.
And to make things more challenging sometimes the sub is called twice
in AUTO_OPEN because it is both the beginning of the week and month.

Also Auto_Open sets other flags that are used for the report
calculations after the report is/are reseted.

There got to be a way to tell Excel to pause the macro until the
resume button is pressed. :)
Any ideas?