'how to add an X=msgbox command using sendkeys vbs

when I try adding the " quotes in

X=msgbox"Writing",48,"Title" 

but the quotes wont recognise.

I've tried using {} but that doesn't help either?



Solution 1:[1]

If you want to capture the result of the MsgBox in variable X, you need to put brackets around the parameters like so:

X = Msgbox("Writing",48,"Title")

Solution 2:[2]

you have to put in chr(34) thats quotes so you should be using the code vvv

thewshkey.sendkeys "x=msgbox" & Chr(34) & "writing" & Chr(34) & ",48," & Chr(34) & "Title" & Chr(34)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Theo
Solution 2 dede ganteng