View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
IanC IanC is offline
external usenet poster
 
Posts: 49
Default Controlling dialog programatically

To answer my own question on this last problem - it is essential to allow
time between activating the UserForm and printing it. This is best achieved
by using something like:

Application.Wait Now + TimeValue("00:00:05")

As the first line of the UserForm_activate macro.

Many thnaks, Bob, for putting me on the right track.


"IanC" wrote:

So close. This now prints all the user forms but (and this is wierd) all but
the first one are printed as blank, i.e. no data boxes, no text, just the
container and the caption. However, each form appears correctly on the
screen, and the system seems to be going through the whole print process
correctly.

I have never come across this situation before when using the individual
PRINT macro. For reference purposes the code on the UserForm_activate is:

If Sheets("MASTER SHEET").Range("f24") < "YES" Then Exit Sub
Call PrintThisPage_Click
PriceData.Hide

where the MASTER SHEET value is equal to YES if coming from the
PrintAllSheets macro and PrintThisPage_Click is the macro that prints the
individual UserForm


"Bob Phillips" wrote:

Can you not put the code in the Userform_Activate event then?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"IanC" wrote in message
...
Hi Bob,

Thanks for the quick response. Unfortunately, I am still getting the same
problem - when the system shows the second user form it just waits for the
user to click a button on the User Form before proceeding with the print.

I cannot see how to initiate the second (and subsequent) prints without

user
intervention.

"Bob Phillips" wrote:

Don't unload it, hide it, it will then still be part of the forms

collection

--
HTH

Bob Phillips

"IanC" wrote in message
...
I have a programme that contains 4 User Forms, all of which display

data.
I
can print them individually by means of a macro connected to a button
(PRINT)
on each user form. However, I cannot make all of them print from a

single
click.

The problem is that the first user form will print, but when I unload

that
and then show the next form, the system sits there waiting for the

user to
click a button on that new form.

Is there any way that I can instruct the system to print each user

form in
turn (i.e. the equivalent of the user pressing the PRINT) and then

proceed
onto the next user form, without the need for user intervention.