循环切换Excel的当前工作表 By FeiYue

注:该脚本来之网络收集

;-----------------------------------
;  循环切换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)
}

 

人已赞赏
AHKV1

单击就删除文件

2020-5-8 20:22:47

AHKV1

托盘图标调用qq,单击截图,双击文字识别

2020-5-11 14:31:47

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索