Valnurat Posted June 14, 2013 Share Posted June 14, 2013 Hi. I'm trying to find text in my Excel. I have download the Beta of Excel UDF and I'm using the _Excel_RangeFind, but I get an error at : Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Sales company", Default, Default, $xlWhole) the error is: "C:UsersusernameDocumentsAppnameExcel Rewrite.au3" (607) : ==> Variable must be of type "Object".: can someone advice me? #include <IE.au3> #include <Excel Rewrite.au3> #include <Array.au3> Local $Openmessage = "Please, open Excel template for One4Al." Local $var = FileOpenDialog($Openmessage, @DesktopDir & "\", "Images (*.xlsx;*.xls)", 1) Global $oAppl = _Excel_Open() If @error Then MsgBox(4096, "", "No File(s) chosen") Else Global $oWorkbook = _Excel_BookOpen($oAppl, $var) ;MsgBox(4096, "", "You chose " & $var) Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Sales company", Default, Default, $xlWhole) MsgBox(4096, "", "The Cell Value is: " & $aSalesResult & @CRLF & @error, 2) _Arraydisplay($aSalesResult, "Excel UDF: _Excel_RangeFind Example 4", -1, 0, "", "|", "Col|Sheet|Name|Cell|Value|Formula|Comment") EndIf Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 14, 2013 Share Posted June 14, 2013 Can you please insert "_Excel_ErrorNotify(2)" before calling _Excel_Open. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 14, 2013 Author Share Posted June 14, 2013 Can you please insert "_Excel_ErrorNotify(2)" before calling _Excel_Open. Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 14, 2013 Share Posted June 14, 2013 If you use Alpha 4 version of the UDF then this message is OK because Excel isn't running when the script is started.Do you get another message? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 14, 2013 Author Share Posted June 14, 2013 If you use Alpha 4 version of the UDF then this message is OK because Excel isn't running when the script is started. Do you get another message? This is all the messages I get. Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 14, 2013 Share Posted June 14, 2013 Thanks or this long list of screenshots Which version of Excel do you run? Which bitness of Excel (32bit, 64bit)? Do you run/compile the AutoIt script for 32 or 64 bit? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 15, 2013 Author Share Posted June 15, 2013 Thanks or this long list of screenshots Which version of Excel do you run? Which bitness of Excel (32bit, 64bit)? Do you run/compile the AutoIt script for 32 or 64 bit? No problem. I use excel 2010 32 bit I haven't compile it yet. I run it as a Beta run from SciTE. My OS is Windows 7 x64 bit Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 15, 2013 Share Posted June 15, 2013 Even when you run it from SciTE bitness is important. Please add "#AutoIt3Wrapper_UseX64=N" at the top of your script. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted June 15, 2013 Share Posted June 15, 2013 Forget my last post. I just noticed that @AutoItX64 = 0. Will have to do further investigation ... My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted June 15, 2013 Share Posted June 15, 2013 I just used the following script with the _Excel1.xls that comes with the UDF and it works fine. I'm running Windows 7 64 bit, Office 2010 32 bit and Autoit 3.3.9.4 #include <IE.au3> #include <Excel Rewrite.au3> #include <Array.au3> Local $Openmessage = "Please, open Excel template for One4Al." Local $var = FileOpenDialog($Openmessage, @ScriptDir & "\", "Images (*.xlsx;*.xls)", 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else Global $oAppl = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oAppl, $var) Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Story*", Default, Default, $xlWhole) _Arraydisplay($aSalesResult, "Excel UDF: _Excel_RangeFind Example 4", -1, 0, "", "|", "Col|Sheet|Name|Cell|Value|Formula|Comment") EndIf My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 15, 2013 Author Share Posted June 15, 2013 Ok, but my file is *.xlsx I just used the following script with the _Excel1.xls that comes with the UDF and it works fine. I'm running Windows 7 64 bit, Office 2010 32 bit and Autoit 3.3.9.4 #include <IE.au3> #include <Excel Rewrite.au3> #include <Array.au3> Local $Openmessage = "Please, open Excel template for One4Al." Local $var = FileOpenDialog($Openmessage, @ScriptDir & "\", "Images (*.xlsx;*.xls)", 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else Global $oAppl = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oAppl, $var) Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Story*", Default, Default, $xlWhole) _Arraydisplay($aSalesResult, "Excel UDF: _Excel_RangeFind Example 4", -1, 0, "", "|", "Col|Sheet|Name|Cell|Value|Formula|Comment") EndIf I don't have any problems with this: Local $aResult = _Excel_RangeRead($oAppl, $oWorkbook, Default, "A1:Y42") Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 15, 2013 Share Posted June 15, 2013 Which Alpha version of the Excel UDF do you use? Only the latest support keyword Default as parameter for the range. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 15, 2013 Author Share Posted June 15, 2013 Which Alpha version of the Excel UDF do you use? Only the latest support keyword Default as parameter for the range. 4 Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 15, 2013 Share Posted June 15, 2013 Ok, but my file is *.xlsx I tested with xls and xlsx files and it was working just fine. Will test with the specified range as soon as possible ... My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 17, 2013 Author Share Posted June 17, 2013 I just used the following script with the _Excel1.xls that comes with the UDF and it works fine. I'm running Windows 7 64 bit, Office 2010 32 bit and Autoit 3.3.9.4 #include <IE.au3> #include <Excel Rewrite.au3> #include <Array.au3> Local $Openmessage = "Please, open Excel template for One4Al." Local $var = FileOpenDialog($Openmessage, @ScriptDir & "\", "Images (*.xlsx;*.xls)", 1) If @error Then MsgBox(4096, "", "No File(s) chosen") Else Global $oAppl = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oAppl, $var) Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Story*", Default, Default, $xlWhole) _Arraydisplay($aSalesResult, "Excel UDF: _Excel_RangeFind Example 4", -1, 0, "", "|", "Col|Sheet|Name|Cell|Value|Formula|Comment") EndIf I have just run this and it is working with my *.xlsx. Maybe it is because my search text looked like this: "*Sales company". Now I searched for "*Sales*" and the I didn't get any errors. I got the attached screenshot. Maybe you could tell me how I check if the highlighted, in the attach file, is true the $bSales = true? Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 17, 2013 Share Posted June 17, 2013 "*Sales company" finds every cell with "Sales company" at the end. If the cell ends with "Sales company " (not the additional space) then it won't be found. So "*Sales company*" is your best bet. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 17, 2013 Author Share Posted June 17, 2013 (edited) If I do this: Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Sales company", Default, Default, $xlWhole) I don't get the: _Arraydisplay($aSalesResult, "Excel UDF: _Excel_RangeFind Example 4", -1, 0, "", "|", "Col|Sheet|Name|Cell|Value|Formula|Comment") But if I do this: Local $aSalesResult = _Excel_RangeFind($oWorkbook, "*Sales*", Default, Default, $xlWhole) I get the screenshot posted in #15 Edited June 17, 2013 by Valnurat Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 17, 2013 Share Posted June 17, 2013 Can you make sure that there isn't a space after "Sales Company"? I tested and a cell with a space at the end isn't found. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valnurat Posted June 17, 2013 Author Share Posted June 17, 2013 Can you make sure that there isn't a space after "Sales Company"? I tested and a cell with a space at the end isn't found. There is no space after "Sales Company"? I could send you the Excel file? Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
water Posted June 17, 2013 Share Posted June 17, 2013 If you like you can send me your Excel file through private mail. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now