[AHK]遍历Excel有哪些Sheet

阅读 42

2023-04-25


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)

0 0 举报