PsaltyDS Posted October 2, 2007 Share Posted October 2, 2007 That might be a discrepancy since _ArrayDisplay() shows me the other way around. Doh! I've made that mistake before too... didn't learn the lesson... #include <ExcelCOM_UDF.au3> #include <Array.au3> $oExcel = _ExcelBookNew () If Not IsObj($oExcel) Then Exit $avCols = StringSplit("A,B,C,D", ",") For $x = 1 To 4 For $y = 1 To UBound($avCols) - 1 _ExcelWriteCell ($oExcel, "Data for " & $avCols[$y] & $x & " cell", $x, $y) Next Next MsgBox(64, "Test", "Waiting to visually check data...") $avData = _ExcelFindInRange($oExcel, "Data", "A1:D4") _ArrayDisplay($avData, "Debug: $avData") _ExcelBookClose ($oExcel) When we write "A1" the column is "A" and the row is "1" (which I get backwards 50% of the time...). When you make calls in ExcelCOM_UDF functions, and give separate numeric coordinates, they are row first then col (as in the _ExcelWriteCell() call above). When you get the array from _ExcelFindInRange(), [x][2] is the column and [x][3] is the row number, exactly the opposite of what the header for the function says in the UDF. That makes it all better! If Locodarwin can get confused by this, then I'm in good company! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valuater Posted October 2, 2007 Share Posted October 2, 2007 Kinda looks likeThe Kid Teaching the Dad!!!...??? lol8) Link to comment Share on other sites More sharing options...
gertsolo Posted October 2, 2007 Author Share Posted October 2, 2007 Kinda looks likeThe Kid Teaching the Dad!!!...??? lol8) Cute and cudlly The more you learn, the less you know. Link to comment Share on other sites More sharing options...
aslani Posted October 2, 2007 Share Posted October 2, 2007 Doh! I've made that mistake before too... didn't learn the lesson...lol, I was scratching my head too since my values were popping out from the wrong cells. That's when I started using _ArrayDisplay() to check the right location. [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version 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