baamr Posted October 2, 2022 Share Posted October 2, 2022 (edited) Hi, Is it possible with Autoit to search for a string in an Excel file and give the result of another cell? Eg. I found my result for a search in cell C4 and want to show the text i have in cell B4. Thanks for any help. Edited October 2, 2022 by baamr Missing ? Link to comment Share on other sites More sharing options...
water Posted October 2, 2022 Share Posted October 2, 2022 Sure. Use function _Excel_RangeFind and the addresses of the cells containing the search string will be part of the returned array. Then use the Offset property to calculate the new address. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
baamr Posted October 3, 2022 Author Share Posted October 3, 2022 Hi, I can not find this method Range.Offset property in Autoit. Is it a part of Autoit? It looks more like VB visual basic? Link to comment Share on other sites More sharing options...
Solution Danp2 Posted October 3, 2022 Solution Share Posted October 3, 2022 Here's one of @water's old examples from the forum -- Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
water Posted October 3, 2022 Share Posted October 3, 2022 (edited) AutoIt allows to access properties and methods of Excel using COM. Details about COM can be found in the AutoIt help file. Edited October 3, 2022 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
baamr Posted October 3, 2022 Author Share Posted October 3, 2022 5 hours ago, Danp2 said: Here's one of @water's old examples from the forum -- Thanks, Think i can sort out something from that one. Link to comment Share on other sites More sharing options...
baamr Posted October 4, 2022 Author Share Posted October 4, 2022 (edited) Hi, I get error with $oExcel not declared as global var. I have Include: array.au3 and excel.au3 Were is $oExcel defined? Edited October 4, 2022 by baamr pic Link to comment Share on other sites More sharing options...
water Posted October 4, 2022 Share Posted October 4, 2022 (edited) $oExcel is the variable to hold the reference to the Excel application object. This is returned by _Excel_Open. You have to declare the variable yourself. Please check the examples in the help file. Edited October 4, 2022 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
baamr Posted October 4, 2022 Author Share Posted October 4, 2022 Thanks again, 🙂 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