Trouble Using One Function for Several Buttons
By
momar33, in AutoIt GUI Help and Support
Recommended Posts
This topic is now closed to further replies..
- By Eminence
Hello,
Is there a way wherein I can access the data from an array coming from an Excel file then have it assigned on to a variable?
Below is a snippet of my current code. For now, it just reads and outputs the data from the excel file and have it displayed via an array.
#include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Local $oExcel = _Excel_Open(False) If @error Then Exit MsgBox(0, "Error", "Error creating application object." & @CRLF & "Error: " & @error & " Extends: " & @extended) ; Open Excel Woorkbook and return object Local $sWorkbook = @ScriptDir & "\Excel Files\Test Data.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, False, True) If @error Then MsgBox(0, "Error", "Error opening workbook'" & $sWorkbook & ".'" & @CRLF & "Error: " & @error & "Extends: " & @extended) _Excel_Close($oExcel) Exit EndIf Local $aResult = _Excel_RangeRead($oWorkbook) ; Error Trapping If @error Then MsgBox(0, "Error", "Error reading data from '" & $sWorkbook & ".'" & @CRLF & "Error: " & @error & " Extends: " & @extended) _Excel_Close($oExcel) Exit EndIf _ArrayDisplay($aResult) My Excel file has values from Column A to H with values from 1 to 30, what I desired to do is have the value in "A7" assigned on to a variable.
Any help is appreciated. Thanks in advance.
- By
Hi, i'm currently facing problems with understanding how arrays work, or atleast a few commands that alter arrays.
My current situation is:
1. I'm taking the process list and putting it all in an array
2. I want to remove the boring common windows processes
3. Profit
And i'm currently stuck on step 2, while i already found this thread it dosn't seem that i can make it do what i want.
Current code:
Local $PList = ProcessList() Local $RL[6] = ["smss.exe", "csrss.exe", "svchost.exe", "iexplore.exe", "chrome.exe", "conhost.exe"] Sleep(1) For $i=1 To Ubound($RL)-1 Sleep(1) While Not @Error $iIndex = _ArraySearch($PList, $RL[$i], 1, 0, 0, 1) _ArrayDelete($PList, $iIndex) WEnd Next It seems to remove all but smss.exe from the array list unless i have it two times in the array.
Note: The sleep(1) is there to clear the error else the command wont fire for the rest of the array, any other way of doing it?