View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How do I include wsh or vbs code/script in an Excel macro

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)

"Naived Merchant" wrote in message
om...
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