Search the Community
Showing results for tags '_excel_bookattach'.
-
My script below was working as of last week but now the book won't attach. The first error code is 1 for the book attach, @extended = -2147352570. When I do the rangeread, it confirms the first error code with a 1 return. I do have two excel sheets running but I didn't think it would matter because the book was attached to the file I want. I've read the help file, tried the example scripts, even had this script working but now its broken. My autoit is up to date. Any ideals? Thanks. #include <Misc.au3> #include <Excel.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> #include <MsgBoxConstants.au3> AutoItSetOption("WinTitleMatchMode", 2) WinActivate("Morning IND") Global $sWorkbook = @DesktopDir & "\Morning IND.xls" Global $oExcel = _Excel_BookAttach($sWorkbook) ; Path to excel file that is on the desktop If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 2", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Global $var1 = _Excel_RangeRead($oExcel, Default, "X47") ; Symbol from X1 If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 2", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
-
If I have workbook open and active besides CardID.xlsm open, the script blows up. Is there anyway to fix this, CardID.xlsm is always open, but if I want to also work in Excel my script basically doesn't function. Local $sWorkbook = "CardID.xlsm" $oWorkbook = _Excel_BookAttach($sWorkbook, "filename") $oWorkbook.parent.run("Run");