Kiti Posted June 17, 2008 Share Posted June 17, 2008 #include <ExcelCOM_UDF.au3> WinActivate("Microsoft Excel - Book1") $oExcel = _ExcelAttach("Microsoft Excel - Book1", "Title") _ExcelSort($oExcel, "A", 1, 1, 25, 1, 2) Locodarwin's UDF. I have a bunch of numbers from A1 to A25. Anyone know why they are not sorted from smallest to largest? The script looks ok to me... Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 17, 2008 Share Posted June 17, 2008 #include <ExcelCOM_UDF.au3> WinActivate("Microsoft Excel - Book1") $oExcel = _ExcelAttach("Microsoft Excel - Book1", "Title") _ExcelSort($oExcel, "A", 1, 1, 25, 1, 2) Locodarwin's UDF. I have a bunch of numbers from A1 to A25. Anyone know why they are not sorted from smallest to largest? The script looks ok to me... ...aaaaaand what happens when you run it? You didn't really post it for someone ELSE to test for you? 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...
Kerros Posted June 17, 2008 Share Posted June 17, 2008 @Kiti My guess is that AutoIT is not attaching to the Excel file. Place an _ExcelWriteCell("Test",2,2) after the attach and you will see that it's not attaching. Now WHY it's not attaching is something I haven't figured out. Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance. Link to comment Share on other sites More sharing options...
Kiti Posted June 17, 2008 Author Share Posted June 17, 2008 ...aaaaaand what happens when you run it? You didn't really post it for someone ELSE to test for you?Anyone know why they are not sortedI think I said what happens... they are not sorted?... Yes, this happens!@KitiMy guess is that AutoIT is not attaching to the Excel file. Place an _ExcelWriteCell("Test",2,2) after the attach and you will see that it's not attaching.Now WHY it's not attaching is something I haven't figured out.It's actually attaching. The "Test" is there on B2 when I run it. There is something wrong with the Sort function I think (in my script) Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 17, 2008 Share Posted June 17, 2008 (edited) I think I said what happens... they are not sorted?... Yes, this happens! It's actually attaching. The "Test" is there on B2 when I run it. There is something wrong with the Sort function I think (in my script) More specifically, _ExcelSort() returns 0 and sets @error if things go wrong, you should also see errors on the SciTE console if an object call failed. What were those results? Edit: Catching errors in _ExcelSort(): #include <ExcelCOM_UDF.au3> WinActivate("Microsoft Excel - Book1") $oExcel = _ExcelAttach("Microsoft Excel - Book1", "Title") $iRET = _ExcelSort($oExcel, "A", 1, 1, 25, 1, 2) $iErrSav = @error $iExtSav = @extended If $iRET Then MsgBox(64, "Success", "Success") Else MsgBox(16, "Error", "Error: $iRET = 0, @error = " & $iErrSav & ", @extended = " & $iExtSav) EndIf Edited June 17, 2008 by PsaltyDS 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...
Kiti Posted June 17, 2008 Author Share Posted June 17, 2008 (edited) Any ideeas, PsaltyDS? Edit: I got it thank you anyway. Instead of "A" as the second sort parameter it should've been "A1" Edited June 17, 2008 by Kiti Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 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