View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl[_3_] Steve Yandl[_3_] is offline
external usenet poster
 
Posts: 117
Default calling an external vbs file on the worksheet close operation

Try this (adjust the path for "close.vbs" of course)

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Shell "C:\WINDOWS\SYSTEM32\WScript.exe C:\Test\close.vbs"
End Sub

Steve



"Gordon Cashmore" wrote in message
...
How do I program to run a file called close.vbs when an excel sheet is
closed.

Thanks for the help

gordo