注:该脚本来之网络收集
;-----------------------------------
; 循环切换Excel的当前工作表 By FeiYue
;
; 注:在我的系统中不能 ComObjActive("Excel.Application")
;-----------------------------------
#A::
if (!objExcel)
{
ControlGet, hwnd, Hwnd,, EXCEL71, ahk_class XLMAIN
objExcel:=Acc_ObjectFromWindow(hwnd,0xFFFFFFF0).Application
}
i:=objExcel.ActiveSheet.Index, j:=objExcel.Worksheets.Count
objExcel.Worksheets[i<j?i+1:1].Activate
return
Acc_ObjectFromWindow(hWnd, idObject = -4)
{
Static h
If (!h)
h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
If DllCall("oleacc\AccessibleObjectFromWindow"
, "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", (VarSetCapacity(IID,16)
+NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64")
+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,IID,8,"Int64"))*0
+&IID, "Ptr*", pacc)=0
Return ComObjEnwrap(9,pacc,1)
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
win+a 利用键盘按顺序切换工作表,好像用处不大,思路可利用.