in reply to Windows; If (2003) MS Word or Excel are already executing?

You can programmatically close windows if you know their handles. Here are two non-tested examples.
use Win32::GuiTest qw/SendMessage/; use Win32::FindWindow; $window = find_window( basename => 'winword.exe' ); SendMessage($window->hwnd,WM_CLOSE,0,0);
OR
use Win32::CtrlGUI; my $window =Win32::CtrlGUI::wait_for_window(qr/Word/); $window->send_keys("!fx"); my $window =Win32::CtrlGUI::wait_for_window(qr/Excel/); $window->send_keys("!fx");
HTH,
SSF