ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling an external vbs file on the worksheet close operation (https://www.excelbanter.com/excel-programming/281827-calling-external-vbs-file-worksheet-close-operation.html)

Gordon Cashmore

calling an external vbs file on the worksheet close operation
 
How do I program to run a file called close.vbs when an excel sheet is
closed.

Thanks for the help

gordo



Steve Yandl[_3_]

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






All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com