How do I include wsh or vbs code/script in an Excel macro

N

Naived Merchant

I want to include a wsh or vbs script code in a macro so that it runs
at the button onclick event. How do I include the script.

TIA
NM
 
B

Bob Phillips

For WSH, you need to cretae a WSH object

Set WSH = CreateObject("WScript.Shell")

and then precede your WSH object and methods with WSH, like so

Select Case WSH.Popup("Please wait", cTime, "Hint", vbOKCancel)


VBScript is so VBAish, that you could probably use as is.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top