excel vba use wait
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA: how to use the "Wait" command

Excel VBA: how to use the "Wait" command

resolvedResolved · Medium Priority · Version 2003

replyReplyMon 27 Oct 2008, 10:48Trainer Katie said...

Excel VBA: how to use the "Wait" command

I understand the command -

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

is to pause the macro for 1 second before execution. But it only pauses at the beginning of the macro and not within.

How do I manipulate the line so it will pause in the middle of my macro.

e.g. My Excel macro suppose to wait for the user to choose paper tray before printing. My code so far pauses for 5 seconds at the beginning before it executes...

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SendKey2Print(prnbin)
' The code below is for copier/printer model: Ricoh 3260C

SendKeys "%(FPR)" 'sets to Print Properties
SendKeys "+{TAB}{RIGHT}" 'switch to tab "Paper"
SendKeys "{TAB 8}" 'switch to input tray
SendKeys "{UP 5}" 'switch to "AutoTray selection"
Application.Wait Now + TimeValue("00:00:05")

SendKeys "{ENTER}"
SendKeys "{ESC}"

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Can anyone help?

For upcoming training course dates see: Pricing & availability

replyReplySun 2 Nov 2008, 22:12Trainer Laura said...

RE: Excel VBA: how to use the "Wait" command

Hi Katie

Thanks for the question took some experiments to find a possible solution.

It seems that the culprit is SendKeys. Can you try adding a ",True" to each line, eg

SendKeys "%(FPR)", True

That seems to make the program work in a linear mode rather than doing the Wait first.

Let me know if it works.

Laura GB

 

 

Please browse our web site to find out more about
vba-excel-training and other Microsoft training courses.

Excel tip:

Date and time

CTRL+ SEMICOLON then SPACE then CTRL+SHIFT+ SEMICOLON

View all Excel hints and tips

forum postHi Andrew

Please can you confirm the 4 formatting checks that I need to carry out prior to setting up an MS Project document. These were detailed during our training day but didnt note down, and don't appear to be in the handbook?

Best

Stuart

» Forum post: Setting up a project, essential first checks

article

The Key To The Perfect Presentation Is Always You

Isn't labour-saving technology wonderful? It's certainly grown to play a huge role in the way presentations are made, across business, academia, politics, science and the arts. However, the role of computers needs to be limited, and the human element must remain at the heart of the presentation if it's to have the best possible impact.

» Article: Presentation skills london


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training