Forum Discussion
hlalumiere
13 years agoRegular Contributor
If all you need to do is save the files that are opened, you could just enumerate the Excel processes, give each of them focus one at a time, and use the keyboard shortcuts to save the files from a TC script:
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set ExcelProcesses = objWMI.ExecQuery("Select * from Win32_Process Where Name = 'EXCEL.EXE'")
arrProcesses = Sys.FindAllChildren("ProcessName", "EXCEL", 1, True)
For Each p In arrProcesses
Set MainWindow = p.Window("XLMAIN", "Microsoft Excel", 1)
MainWindow.SetFocus
Sys.Keys "^s"
Next