-
Notifications
You must be signed in to change notification settings - Fork 0
/
automate-excel-link-refresh.ahk
52 lines (45 loc) · 1.07 KB
/
automate-excel-link-refresh.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#SingleInstance Force
CtrlBreak:: ;hold Ctrl+Pause | Ctrl+ScrollLock
Pause On
Return
#IfWinActive ahk_class XLMAIN
!F5::
title = Excel Link Refresh
references_count := 11
Loop {
WinActivate ahk_class XLMAIN
ControlGetFocus focus, ahk_class XLMAIN
If (focus = "EXCEL72") {
MsgBox 5, %title%, Warte auf Aktivierung der Bearbeitung für das Spreadsheet..., 3
IfMsgBox Cancel
Return
}
Else
Break
}
Loop %references_count% {
Send !vv
;WinWait ahk_class bosa_sdm_XL9
limit := A_Index - 1
Send {Down %limit%}{Tab 3}{Enter}
Sleep 1000
If WinActive("ahk_class XLMAIN") ;doesn't work sadly
Send !{F4}
Sleep 400
}
MsgBox 0, %title%, Fertig! %references_count% Verknüpfungen wurden aktualisiert., 3
Return
/*
Dokumentation zu MsgBox:
https://ahkde.github.io/docs/commands/MsgBox.htm
*/
/*
Potentiell bessere Alternativen zu "Send !{F4}":
WinWaitActive, ahk_class XLMAIN,,,Admanager
MsgBox large found
WinClose ,;20_21.xlsx - Excel
Sleep, 2000
WinClose, ahk_class XLMAIN,,,Admanager ;, Excel, ExcludeTitle:=Admanager
WinClose, A
WinWaitClose
*/