From 358d466006ed2a80f78e97982559b82508e96af6 Mon Sep 17 00:00:00 2001 From: telppa <68984587+telppa@users.noreply.github.com> Date: Tue, 28 Feb 2023 23:39:36 +0800 Subject: [PATCH] Update ExcelToArray.ahk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 大幅批量处理excel文件时的速度 --- ExcelToArray.ahk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ExcelToArray.ahk b/ExcelToArray.ahk index 8dae7d2..8161098 100644 --- a/ExcelToArray.ahk +++ b/ExcelToArray.ahk @@ -1,4 +1,4 @@ -; v1.1 (2018-7-19) +; v1.1 (2018-7-19) ; https://github.com/tmplinshi/ExcelToArray ExcelToArray(FileName, nSheet := 1, last_row := "", last_column := "") @@ -20,13 +20,13 @@ class ExcelToArray GetSafeArrFromXlFile(FileName, nSheet := 1, last_row := "", last_column := "") { + static xlObj := ComObjCreate("Excel.Application") fPath := this.GetFullPath(FileName) if this.IsFileInUse(fPath) { try wb := this.GetWorkbook(fpath) } if !wb { - xlObj := ComObjCreate("Excel.Application") xlObj.Workbooks.Open(fPath) wb := xlObj.ActiveWorkbook }