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

  • Thread starter Thread starter Naived Merchant
  • Start date Start date
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top