Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I just got a UPS for our computer that has the ability to run any program/batch file/etc that can be executed from the command line when the power goes out. I want to somehow make a batch file or something that will be able to execute the below code when the power goes out. This is the same code that is normally executed by the user at the end of the night by pressing a button. Code: -------------------- Sub SHUTDOWN_WIN() If Worksheets.count 1 Then unhideall Call split_worksheet_to_workbook End If Application.DisplayAlerts = False ActiveWorkbook.Save Call Shell("c:\windows\system32\Shutdown.exe -s -t 0", 1) ActiveWorkbook.Close Application.DisplayAlerts = True End Sub -------------------- This code must somehow be executed from within the workbook itself as it calls other functions. I don't know if this is possible or not but it sure would be handy... -- clayton ------------------------------------------------------------------------ clayton's Profile: http://www.excelforum.com/member.php...fo&userid=4563 View this thread: http://www.excelforum.com/showthread...hreadid=492816 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need help righting script to sort rows alphabetically then seperate them to line up | Excel Worksheet Functions | |||
VB Script error | Excel Discussion (Misc queries) | |||
OsCommerce - Easy Populate Script - CSV/TXT Conversion Problem. | Excel Discussion (Misc queries) | |||
VBA script help..Please !!!! | Excel Discussion (Misc queries) | |||
Using a VB Script for barcodes - new to this | Excel Discussion (Misc queries) |