Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func ExcelWorkbooks()
- ; Error handler, automatic cleanup at end of function
- Local $oError = ObjEvent("AutoIt.Error", "__Excel_COMErrFunc")
- #forceref $oError
- Local $oWorkbook, $iCount = 0, $sCLSID_Workbook = "{00020819-0000-0000-C000-000000000046}" ; Microsoft.Office.Interop.Excel.WorkbookClass
- Dim $sBooks[100]
- While True
- $oWorkbook = ObjGet("", $sCLSID_Workbook, $iCount + 1)
- If @error Then
- ReDim $sBooks[$iCount]
- Return $sBooks
- EndIf
- $sBooks[$iCount] = $oWorkbook.FullName
- $iCount += 1
- WEnd
- EndFunc ;==>ExcelWorkbooks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement