gto70070 Posted March 14, 2020 Share Posted March 14, 2020 First of all, my English is not very good. This is translated directly from Google. I want to make an excel form to store data and read or change Where should I start? Regarding the _Excel_RangeFind function, I directly use the demo script Spoiler #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\Extras\_Excel1.xls") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example", "Error opening workbook '" & @ScriptDir & "\Extras\_Excel1.xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; Find all values with "Story" at the end using wildcards and exact match Local $aResult = _Excel_RangeFind($oWorkbook, "* Story", Default, Default, $xlWhole) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 4", "Error searching the range." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 4", "Find all values with 'Story' at the end using wildcards and exact match." & @CRLF & "Data successfully searched.") _ArrayDisplay($aResult, "Excel UDF: _Excel_RangeFind Example 4", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") But got the following error How can I overcome it? Thanks everyone for helping🤗 Link to comment Share on other sites More sharing options...
gto70070 Posted March 14, 2020 Author Share Posted March 14, 2020 EXCEL_demonstration.xlsx This is my demonstration How to start making him enter automatically and query him Thanks again Link to comment Share on other sites More sharing options...
Nine Posted March 14, 2020 Share Posted March 14, 2020 (edited) Did you move the example script from AutoIt examples folder to your folder ? If so, you will need to copy also the excel1.xls file to your folder and adjust the path accordingly. The simplest way to query your excel sheet is to range read the whole sheet and put it into a 2D array where you can do array search easily. Look Excel UDF and Array UDF from help file. Edited March 14, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
gto70070 Posted March 15, 2020 Author Share Posted March 15, 2020 6 hours ago, Nine said: 您是否將示例腳本從AutoIt示例文件夾移動到您的文件夾?如果是這樣,您還需要將excel1.xls文件複製到您的文件夾中,並相應地調整路徑。 查詢Excel工作表的最簡單方法是范圍讀取整個工作表並將其放入2D數組中,您可以在其中輕鬆進行數組搜索。從幫助文件中查看Excel UDF和Array UDF。 Which is the example file? Can I create EXCEL and enter values just like creating a TXT file Conversion_example.au3 This is a script I wrote out using TXT file I believe that EXCEL should have better results Link to comment Share on other sites More sharing options...
gto70070 Posted March 15, 2020 Author Share Posted March 15, 2020 I found that I used the wrong function Should use _Excel_BookNew to create EXCEL Researched for a morning and finally found out the problem thanks for the reply😁 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