DaLiMan Posted November 10, 2004 Share Posted November 10, 2004 I'm still having trouble with the ControlSend (Plus) function. Does anyone understand why the script below isn't working? Run("C:\Program Files\Microsoft Office\Office11\EXCEL.EXE", "", @SW_MINIMIZE) WinWait("Microsoft Excel - Book1") ControlSend("Microsoft Excel", "", "", "{ALT}",0) ControlSend("Microsoft Excel", "", "", "T",0) ControlSend("Microsoft Excel", "", "", "I",0) Excel starts up - WinWait also does his job, but then all goes wrong..... When I start Excel MAXIMIZED all goes great!!! Link to comment Share on other sites More sharing options...
this-is-me Posted November 10, 2004 Share Posted November 10, 2004 You are controlsending without a control to send to. You need to at least do an altdown before the t and an altup after. You also need to change the case of the t from T to t because T is SHIFT+t and t is just t. Try this to completely replace the last three lines: ControlSend("Microsoft Excel", "", "", "{ALTDOWN}t{ALTUP}i") Who else would I be? Link to comment Share on other sites More sharing options...
DaLiMan Posted November 10, 2004 Author Share Posted November 10, 2004 OK, thought i tried everything..... Eventhough, the code you suggested stil don't make my script work. The HELP file says: Note, this function cannot send all the characters that the usual Send function can (notably ALT keys) but it can send most of them--even to non-active or hidden windows! Could this be the case here? Is this an Excel problem? Link to comment Share on other sites More sharing options...
DaLiMan Posted November 10, 2004 Author Share Posted November 10, 2004 Hi Larry, I'm trying to find the menu like u said, but without result. What does your window spy say about Excel? I've tried: MsoCommandBar7 Worksheet Menu Bar MsoWorkPane EXCEL73 So far without result. I'm not sure what I'm looking for. I don't have anything what sounds like "ToolbarWindow322" as you suggested. PS: I have to look under >>>>>>>>( Last Control Under Mouse )<<<<<<< don't I ???? Link to comment Share on other sites More sharing options...
DaLiMan Posted November 10, 2004 Author Share Posted November 10, 2004 Yes, This works for me too.But, only when you don't MINIMIZE or HIDE the workbook.When I run Excel MINIMIZED you hear the keyboard error sound from the PC and indeed nothing happens.But I think the problem is within Excel.I just found that when you open Excel MAXIMIZED and do the ALT-t-i keycombination you get a PopUp window for the AddIn's.Now, you cannot MINIMIZE / MAXIMIZE / CLOSE Excel when this PopUp is open.So, I think the other way around is also true.You cannot open this PopUp while Excel is MINIMIZED or HIDDEN.Tell me what you think.I'm open for suggestions.PS: I use Excel 2003 over here. Link to comment Share on other sites More sharing options...
DaLiMan Posted November 10, 2004 Author Share Posted November 10, 2004 Yes, I was trying to create an AddIn installer for Excel. I found that a key was written like: RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options", "OPEN7", "REG_SZ", '"CQRButton.xla"') This worked on my PC, but when I tried it on another PC (who didn't have the xla installed before) this key wasn't enough. You had to open en close the Settings Dialog for the AddIn's and close and reopen Excel to make it work. So I thought to make this in Auto-It and do it hidden or minimized. Have to find another way, or maybe do it not so stealthy... Link to comment Share on other sites More sharing options...
scriptkitty Posted November 10, 2004 Share Posted November 10, 2004 I have had some luck (strangely) with programs that need focus to control send. I hide them instead of minimise. I still have to change focus but it works for me on some stubborn ones. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
DaLiMan Posted November 11, 2004 Author Share Posted November 11, 2004 Hi scriptkitty, Tried what you proposed it just now, but Excel just won't allow it. I guess I just have to do it not hidden or minimized. Thanx anyway. Link to comment Share on other sites More sharing options...
scriptkitty Posted November 11, 2004 Share Posted November 11, 2004 (edited) My version is a bit different from yours, but I was able to send all the commands to it, minimized, or hidden. My problem was that when minimized or hidden, the commands have popup boxes. The popup boxes have trouble when minimised. I also had to use a control, I played with serveral I found with AutoIt spy, and changed a part of the code to make it faster: WinWait("Microsoft Excel - Book1") $control="MsoCommandBar2" winsetstate("Microsoft Excel", "",@sw_minimize) ControlSend("Microsoft Excel", "", $control, "!d") ControlSend("Microsoft Excel", "", $control, "S") sleep(1000) winsetstate("Microsoft Excel", "",@sw_restore) you might try moving it off the screen a tad too. $pos=wingetpos("Microsoft Excel - Book1") winmove("Microsoft Excel - Book1","",1000,1000) ; your code winmove("Microsoft Excel - Book1","",$pos[0],$pos[1]) Edited November 11, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
DaLiMan Posted November 12, 2004 Author Share Posted November 12, 2004 Thanx scriptkitty, This moving it of the screen is a nice option. The dialog box is stil popping up in sight, but I think that's not a problem. Maybe I can move this box too. That way, it still is sort of "stealthy" Link to comment Share on other sites More sharing options...
blademonkey Posted January 19, 2006 Share Posted January 19, 2006 Thanx scriptkitty,This moving it of the screen is a nice option.The dialog box is stil popping up in sight, but I think that's not a problem.Maybe I can move this box too.That way, it still is sort of "stealthy"Have you gotten your XLA installer to work? I am currently trying to do the same thing. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung 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