0
点赞
收藏
分享

微信扫一扫

[AHK]遍历Excel有哪些Sheet

何晓杰Dev 2023-04-25 阅读 41


oExcel :=   ComObjActive("Excel.Application")
for Item in oExcel.workbooks
{
   data .=   "Name:`t"oexcel.workbooks(A_index).FullName  "`n"
    oexcel.ActiveWindow.Caption :=  oexcel.ActiveWorkbook.FullName 
	filename:=Item.FullName
	IfInString,filename,Test.xlsx
	{
		count:=Item.Sheets.Count
		loop,%count%
		{
			name .= Item.Sheets(A_index).name "`n"
			
		}
		MsgBox %name%
	}
}
oexcel.Worksheets("Sheet2").Select
objRelease(oExcel)



举报

相关推荐

0 条评论