Reputation: 330
I'm having trouble making a Msgbox modal. Every time I add ', +vbSystemModal' to the end, it just breaks my script saying -Invalid procedure call or argument: 'Msgbox'-
I'm using something similar to the following code (but, longer, with more calls and stuff)
MsgBox "Hello " & objUser.givenName & ", Please note that your password Expires in " & daysLeft & " day(s)" & " at " & whenPasswordExpires & chr(13) & chr(13) & "You have less than one day left! It is advised that you update your password immediately to avoid network issues." & chr(13) & chr(13) & "Please press CTRL-ALT-DEL and select the 'Change a password' option before your password expires!", "PASSWORD EXPIRATION WARNING!", +vbSystemModal
Is it calling the daysleft and username that breaks it? How can I work around this to make it a modal message?
thanks in advance.
EDIT: As explained above, using ", +vbSystemModal" simply breaks the script.
Upvotes: 2
Views: 5976
Reputation: 330
Using the following worked:
MsgBox "Message goes here!", 4096, "Title of message!"
The 4096 sets it as a Msgbox with an 'OK' option and modal settings.
This works better than ", +vbSystemModal" when your message is broken up as you call information.
Upvotes: 3