Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

JamieArvato (TechnicalUser)
6 Aug 04 7:12
I'm running print all sheets code and for some reason it is not printing the sheets in order.......

I want to put in a 1 second wait in the Next Print function to allow each sheet to go to the printer in order.

Thanks
Helpful Member!  xlbo (MIS)
6 Aug 04 7:15
goto VBE
Press F1
type "Wait"
read results

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question

JamieArvato (TechnicalUser)
6 Aug 04 7:26
Have'nt got the help files installed and the network does not allow an instal.

Can anybody post it as I need something asap.

Thanks.
Molby (TechnicalUser)
6 Aug 04 7:32
Try:

CODE

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
xlbo (MIS)
6 Aug 04 7:33
Whilst this would take about 5 seconds to download from google, here is the extract from the help file. I would strongly suggest you get your IT dept to install your help files as this is NOT a helpdesk site:

Wait Method
See Also Applies To Example Specifics
Pauses a running macro until a specified time. Returns True if the specified time has arrived.

Important   The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue.

expression.Wait(Time)

expression   Required. An expression that returns an Application object.

Time   Required Variant. The time at which you want the macro to resume, in Microsoft Excel date format.

Example
This example pauses a running macro until 6:23 P.M. today.

Application.Wait "18:23:00"
This example pauses a running macro for approximately 10 seconds.

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
This example displays a message indicating whether 10 seconds have passed.

If Application.Wait(Now + TimeValue("0:00:10")) Then
    MsgBox "Time expired"
End If

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question

JamieArvato (TechnicalUser)
6 Aug 04 7:41
Thank you and apologies.
Wicca (TechnicalUser)
17 Aug 04 7:37
Could you possibly use

Application.ontime now + timevalue("00:00:01")

somewhere in a loop?

This would allow Excel to continue running and put a 1 second delay in the process

Merry Part and the Brightest of Blessings

With respect
Wicca
-----
IF you think you can
Or
If you think you can't
Then
You are probably right
         -Henry Ford

rgbanse (MIS)
18 Aug 04 14:39
This works for me.

Public Function Pause(Delay As Double, Optional Increment As String)
'Example: Pause (3) will delay program continuation for 3 seconds
'Created by RGB 10 May, 2001
'Modified by RGB 10 July, 2002 - added Increment option
'Example: Pause (3,"S") will delay program continuation for 3 seconds
'Example: Pause (3,"M") will delay program continuation for 3 minutes
'Example: Pause (3,"H") will delay program continuation for 3 hours

Dim PauseTime, Start, Finish, TotalTime
If Increment = "" Then Increment = "S"
    Select Case Increment
        Case Is = "S"   ' Sets length of pause for seconds.
            PauseTime = Delay
        Case Is = "M"   ' Sets length of pause for minutes.
            PauseTime = Delay * 60
        Case Is = "H"   ' Sets length of pause for hours.
            PauseTime = Delay * 3600
        Case Else   'Checks for valid Increment value and displays message box in invalid
            MsgBox "Pause(" & Delay & ") - Defaults to seconds." & vbCr _
            & "Pause(" & Delay & ",""S"")" & vbCr _
            & "Pause(" & Delay & ",""M"")" & vbCr _
            & "Pause(" & Delay & ",""H"")" & vbCr _
            & "Are the only valid values - please re-enter and try again."
            Exit Function
    End Select
    
'Here's where the delay starts
    Start = Timer   ' Starts the delay.
    Do While Timer < Start + PauseTime
        DoEvents    ' Let other stuff run while paused.
    Loop
    
End Function
JeaShe (Programmer)
26 Apr 05 11:49
I would like something like this I think... I need to have my macro wait to continue until a print job is done as I then close the document and application that I sent to the printer.

I use another program - Extra Basic - to write the macro that does this.  So I would need to adjust the code to fit my application.

Bottom line is How do I know when it is safe to close a document once I've sent it to the printer. Is there some sort of return code that lets me know the printer accepted the job, etc.?  Thanks

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close