mary Posted October 2, 2006 Share Posted October 2, 2006 (edited) Hi !Why my code below gives an error (==> The requested action with this object has failed.: ) only when i click or do any manuel action on the workbook ?thinks for any helphere juste an exemple to understand what i mean (just run it and tray to click in the opened workbook)$oExcel = ObjCreate("Excel.Application") $oExcel.visible =1 $oExcel.workbooks.add while 1 With $oExcel.activesheet .cells(1,1).value = @HOUR .cells(1,2).value = @MIN .cells(1,3).value = @SEC Endwith sleep(250) WEndthe error is :==> "The requested action with this object has failed.:" Edited October 2, 2006 by mary Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 Works great for me. Do you have the latest AutoIt beta installed and activated? The normal version of AutoIt isn't very good with this sort of thing. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
mary Posted October 2, 2006 Author Share Posted October 2, 2006 Works great for me. Do you have the latest AutoIt beta installed and activated? The normal version of AutoIt isn't very good with this sort of thing.Yes I have the latest beta but the problem is the same ! Did you try to click in a any cells when my autoit script runs ?? I said: the problem is Only when you click on workbook sheets .thinks a lot for your help Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 Ah, no I didn't try clicking. Sorry, I should have actually read what you typed. Try this:$oExcel = ObjCreate("Excel.Application") $oExcel.visible =1 $oExcel.workbooks.add $thesheet = $oExcel.activesheet while 1 With $thesheet .cells(1,1).value = @HOUR .cells(1,2).value = @MIN .cells(1,3).value = @SEC Endwith sleep(250) WEnd [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 (edited) Actually that doesn't fix it either. Sorry. This kind of aleviates it:$oExcel = ObjCreate("Excel.Application") $oMyError = ObjEvent("AutoIt.Error","COMflict") Func COMflict() Consolewrite("COMflict:"&@HOUR&":"&@MIN&":"&@SEC & @CRLF) Endfunc $oExcel.visible =1 $oExcel.workbooks.add $thesheet = $oExcel.activesheet while 1 With $thesheet .cells(1,1).value = @HOUR .cells(1,2).value = @MIN .cells(1,3).value = @SEC EndWith sleep(1000) ; clocks don't need to be updated more than once per second. WEndApparently Excel COM is not designed to allow concurrent operations. If you mess around in another cell or sheet while the script is running, the time cells will not update until you finish editing, or finish moving the selection around. Edited October 2, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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