Alternative to Workbook_Open()????

R

Robert Crandal

I am using the Workbook_Open() subroutine to immediately
display a userform that contains a Date&TimePicker control.
To make a long story short, the DTPicker control seems
to be having problems erasing the calendar from the background
after it is closed out.......which leads me to believe that
perhaps it is not a good idea to display modal userforms
that wait for the user to press the "Ok" button???

Just for testing purposes, what are some other ways that I
can immediately display a modal userform after a workbook
is opened???

thank u
 
J

Jim Cone

DoEvents will usually clean things up after closing a form.
--
Jim Cone
Portland, Oregon USA


"Robert Crandal" <[email protected]>
wrote in message I am using the Workbook_Open() subroutine to immediately
display a userform that contains a Date&TimePicker control.
To make a long story short, the DTPicker control seems
to be having problems erasing the calendar from the background
after it is closed out.......which leads me to believe that
perhaps it is not a good idea to display modal userforms
that wait for the user to press the "Ok" button???

Just for testing purposes, what are some other ways that I
can immediately display a modal userform after a workbook
is opened???

thank u
 
R

Robert Crandal

So is it generally always a good idea to run code like this:

Userform1.Show
DoEvents ' Always after Userform1.show???


I never really noticed any problems with displaying modal
userforms until I put the Userform1.Show() code into
the Workbook_Open() subroutine and ran the file
in a server type system.
 
J

Jim Cone

I tend toward always using it unless the form is unloaded immediately after it is shown.
--
Jim Cone
Portland, Oregon USA
(some useful Excel downloads at... http://excelusergroup.org/ )



"Robert Crandal" <[email protected]>
wrote in message So is it generally always a good idea to run code like this:
Userform1.Show
DoEvents ' Always after Userform1.show???
I never really noticed any problems with displaying modal
userforms until I put the Userform1.Show() code into
the Workbook_Open() subroutine and ran the file
in a server type system.
 
R

Robert Crandal

Hi Jim....

It just occurred to me that my problem is happening WHILE
the modal dialog is displayed, not AFTER! Therefore, running
DoEvents once the dialog box closes might not fix my problem
after all.

Basically, there is one DateTimePicker control on top of
my userform. When the calendar graphic is opened then closed,
I noticed that the calendar graphic remains visible in the background,
almost as if it skipped a repaint step or refresh or something like that.

Do you have any other ideas as to what is going on here?

thanx
 

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

Top