Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2024, 07:01 AM
RobiNew RobiNew is offline Is there an 'Application.Wait' function in Word VBA? Windows 10 Is there an 'Application.Wait' function in Word VBA? Office 2016
Competent Performer
Is there an 'Application.Wait' function in Word VBA?
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Question Is there an 'Application.Wait' function in Word VBA?

Hi,
I tried the 'Application.Wait' function in a Word macro, but it didn't work. Is it restricted to Excel?


Thanks, RobiNew
Reply With Quote
  #2  
Old 08-25-2024, 07:09 AM
Italophile Italophile is offline Is there an 'Application.Wait' function in Word VBA? Windows 11 Is there an 'Application.Wait' function in Word VBA? Office 2021
Expert
 
Join Date: Mar 2022
Posts: 541
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by RobiNew View Post
Is it restricted to Excel?
Yes, as IntelliSense, or the Object Browser, would have shown you.
Reply With Quote
  #3  
Old 08-25-2024, 07:28 AM
RobiNew RobiNew is offline Is there an 'Application.Wait' function in Word VBA? Windows 10 Is there an 'Application.Wait' function in Word VBA? Office 2016
Competent Performer
Is there an 'Application.Wait' function in Word VBA?
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default

Many thanks, Italophile! If that is the case, how can I slow down a Word macro?
Reply With Quote
  #4  
Old 08-25-2024, 08:36 AM
gmaxey gmaxey is offline Is there an 'Application.Wait' function in Word VBA? Windows 10 Is there an 'Application.Wait' function in Word VBA? Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Add the following at the module level:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Run the following as a demo:
Code:
Sub Demo()
Dim lngIndex As Long
  For lngIndex = 1 To 10
    Doze 500
  Next lngIndex
  MsgBox "Done"
End Sub

Sub Doze(ByVal lngPeriod As Long)
  DoEvents
  Sleep lngPeriod
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 08-26-2024, 02:46 AM
RobiNew RobiNew is offline Is there an 'Application.Wait' function in Word VBA? Windows 10 Is there an 'Application.Wait' function in Word VBA? Office 2016
Competent Performer
Is there an 'Application.Wait' function in Word VBA?
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default

Many thanks, gmaxey! Your code is perfect, but I need a simpler solution for my complex macro. All the best!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show wait cursor during vba script? BrianHoard Word VBA 4 08-27-2022 08:08 AM
Share Function is NOT linking to the application mlawton OneNote 0 05-22-2018 02:17 PM
Wait (hourglass) cursor constantly flashing after loading large file didlinghill Word 4 01-26-2015 06:08 AM
Is there an 'Application.Wait' function in Word VBA? Wait for 2013? Warranty issue.... alexb123 Office 1 12-14-2012 01:44 PM
Is there an 'Application.Wait' function in Word VBA? Applicatin.wait SDondeti Word VBA 1 05-27-2011 02:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft