Is there a wait/pause/delay function that is usable in Visio VBA? In Excel VBA there is an Application.wait method but Visio doesn't appear to have one.
I want to display a non-modal message box prior to an operation that's going to take awhile (relatively speaking) and then clear the box when the work is finished. In Excel VBA, this does the trick (PleaseWaitForm is a VBA UserForm):
Load PleaseWaitForm
PleaseWaitForm.Show (vbModeless)
xlApp.Wait (Now + TimeValue("0:00:01"))
do the work...
PleaseWaitForm.Hide
Unload PleaseWaitForm
Anything similar in Visio VBA? Or a totally different technique to achieve the same thing?
Thanks,
Scott
If the work bit is going to take a while why do you need a wait period?
Do you know how long it will take and will that not change with different speed PCs?
its crude and brute force....but I used the timer function for the visio animation stuff I posted here
It appeared to have decent control/resolution...increments of about 150ms on my T60p
Are you looking to have the form displayed for a minimum amount of time, if the work is completed sooner. If not, you have no need of the delay.
If you want the form for a minimum time or until the work has completed,
Public Declare Sub Sleep Lib "kernel32" ( ByVal dwMilliseconds As Long)
dim sTime as single
stime = Timer
pleaseWaitForm.show(vbModeless)
... do work ...
if Abs(Timer - sTime) < FORM_DISPLAY_SECS then
call Sleep abs(time-stime)*1000
endif
pleaseWaitForm.hide
Maybe I am missing the point of this...
but what is your intention with the form?
to inform the user work is being done and it could take a while?
why not use a form with a progress bar moving from 0 to 100% ?
it'll inform the user work is being done and won't detain them any
longer then neccessary...
Thanks for the suggestions. To answer a couple of the questions:
- Paul: the wait period is just so the form is displayed for at least that long. And I don't really care how long the operation will take, but just want the user to see a (moderately) comforting message such as "work in progress... please wait..." rather than staring at the Visio drawing wondering whether anything is happening.
- vojo: I'll take a look at your timer function.
- Andy: Yes, I want the form to display for a minimum amount of time -- just a second or two -- even if the work takes less than that. That's useful but less critical than having the form displayed when the work takes longer.
- Michael: I could use a progress bar but think that's overkill for my situation.
Browser ID: smf
(is_webkit)
Templates: 1:
Printpage (default).
Sub templates: 4:
init,
print_above,
main,
print_below.
Language files: 1:
index+Modifications.english (default).
Style sheets: 0:
.
Hooks called: 60 (
showintegrate_autoload, cache_get_data, integrate_pre_load, integrate_load_session, integrate_verify_user, cache_get_data, integrate_user_info, integrate_load_board, cache_get_data, integrate_board_info, cache_get_data, integrate_allowed_to_general, integrate_allowed_to_general, integrate_boards_allowed_to, integrate_mod_cache, integrate_allowed_to_general, integrate_pre_load_theme, cache_get_data, integrate_allowed_to_general, integrate_simple_actions, integrate_allowed_to_general, integrate_load_theme, integrate_pre_log_stats, cache_get_data, integrate_actions, integrate_pre_parsebbc, integrate_bbc_codes, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_menu_buttons, integrate_current_action, integrate_theme_context, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general)
Files included: 25 - 925KB. (
show/home/iw0lkfe3x6cq/public_html/vgforum/index.php, /home/iw0lkfe3x6cq/public_html/vgforum/Settings.php, /home/iw0lkfe3x6cq/public_html/vgforum/cache/db_last_error.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/QueryString.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Auth.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Errors.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Load.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Security.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Compat.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Db-mysql.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApi.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApiInterface.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/APIs/FileBased.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Charset.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/Metadata.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/QuickCheck.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Session.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Logging.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Class-BrowserDetect.php, (Current Theme)/languages/index.english.php, (Current Theme)/languages/Modifications.english.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Printpage.php, (Current Theme)/Printpage.template.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/CaseUpper.php)
Memory used: 747KB.
Tokens:
post-login.
Cache hits: 8: 0.00120s for 22,301 bytes (
showget modSettings: 0.00044s - 19982 bytes, get known_languages: 0.00016s - 1277 bytes, get board_parents-0: 0.00011s - 2 bytes, get permissions:-1: 0.00010s - 50 bytes, get theme_settings-1: 0.00011s - 980 bytes, get hostlookup-216.73.216.125: 0.00001s - 0 bytes, get log_online-update: 0.00026s - 10 bytes, get menu_buttons--1-english: 0.00003s - 0 bytes)
Cache misses: 2: (
showget hostlookup-216.73.216.125, get menu_buttons--1-english)
Queries used: 11.
[Show Queries]