calling an external vbs file on the worksheet close operation

  • Thread starter Thread starter Gordon Cashmore
  • Start date Start date
G

Gordon Cashmore

How do I program to run a file called close.vbs when an excel sheet is
closed.

Thanks for the help

gordo
 
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
 
Back
Top