I've been using a script of months nearly a year without issues.
Recently I upgraded from office 2016 to 365 and I am having an issue when I try to implement the line xl.activesheet.usedrange.unmerge
have no clue what this is and I don't know if you've seen this before.
Here is my full code
Code: Select all
send ^{F2}
sleep, 1000
send {Enter}
WinWait, Requests Module - Custom Filter - Occurrence List - Q-Pulse - Print Preview
hWnd3 := WinExist(winTitle3) ; Get Custom complaint report hWnd
if (hWnd3) {
DllCall("ShowWindow", ptrS, hWnd3, "Int", 3) ; Maximize the window
}
Sleep, 100
Click, 668, 93
Sleep, 12
Click, 770, 309
Sleep, 12
Send {Enter}
Sleep, 500
WinGet,ID,ID,A
WinActivate,ahk_id %ID%
loop {
WinActivate,ahk_id %ID%
send !{d}
Sleep, 250
} until WinActive("Save As ahk_class #32770")
WinWaitActive, Save As
sleep, 250
awt := "\\private\PTC Forms"
ControlSetText,Edit2, %awt%
sleep, 25
Send {Enter}
sleep, 50
Send !{s}
Sleep, 100
send {y}
Sleep, 50
send {y}
WinWait, Custom Filter - Occurrence List - Q-Pulse.xls - Compatibility Mode - Excel
hWnd4 := WinExist(winTitle4) ; Get hWnd
if (hWnd4) {
DllCall("ShowWindow", ptrS, hWnd4, "Int", 3) ; Maximize the window
}
sleep, 2500
xl:= ComObjActive("Excel.Application")
xl.ActiveWorkbook.SaveAs("\\private\PTC Forms\KPI values.xlsx",51)
xl.ActiveWorkbook.Close
sleep, 1000
run, \\private\PTC Forms"\KPI values.xlsx
sleep, 3000
xl.activesheet.usedrange.unmerge