NSearch Posted April 13, 2005 Share Posted April 13, 2005 Hello everyone. I am very new to AutoIt, infact this is my first post and I am only about an hour into the discovery of this seemly wonderful program. To run a macro in excel open the .xls file, and then hold down (ctrl, shift, and i), but I would like to do this is AutoIt. So far I am able to open the specific .xls file that I want. I have tried the send() command, but it is not working send("^i") Thank you in advance for your help, and I am very glad that I found this program, it is going to be extreamly useful! Link to comment Share on other sites More sharing options...
bshoenhair Posted April 13, 2005 Share Posted April 13, 2005 (edited) I have tried the send() command, but it is not working send("^i")<{POST_SNAPBACK}>You are only sending "Ctrl and i" and you say you need to send "ctrl, shift, and i"Shouln't it be send("^+i") not send("^i")Post your script to examine. Edited April 13, 2005 by bshoenhair Link to comment Share on other sites More sharing options...
NSearch Posted April 13, 2005 Author Share Posted April 13, 2005 (edited) Run("C:\Program Files\Microsoft Office\Office\EXCEL.EXE C:\fedxrem\upseinv_analysis.xls") Send("^+i") This also does not work Edited April 13, 2005 by NSearch Link to comment Share on other sites More sharing options...
bshoenhair Posted April 13, 2005 Share Posted April 13, 2005 Run("C:\Program Files\Microsoft Office\Office\EXCEL.EXE C:\fedxrem\upseinv_analysis.xls")Send("^+i")This also does not work<{POST_SNAPBACK}>Need to use WinWait to allow time for workbook to load.tryRun("C:\Program Files\Microsoft Office\Office\EXCEL.EXE C:\fedxrem\upseinv_analysis.xls") WinWait("Microsoft Excel - upseinv_analysis.xls","");;YOU MIGHT NEED TO CHANGE TITLE IF IT DIFFERS Send("^+i") Link to comment Share on other sites More sharing options...
NSearch Posted April 13, 2005 Author Share Posted April 13, 2005 I was just about to ask if I had to wait for it to load up. I really like this already! Link to comment Share on other sites More sharing options...
NSearch Posted April 13, 2005 Author Share Posted April 13, 2005 (edited) How do I send an <enter> command? Disreguard, I found it. Edited April 13, 2005 by NSearch Link to comment Share on other sites More sharing options...
bshoenhair Posted April 13, 2005 Share Posted April 13, 2005 Send("{ENTER}") Link to comment Share on other sites More sharing options...
bshoenhair Posted April 13, 2005 Share Posted April 13, 2005 (edited) Did you "WRITE" this macro in VBA or did excel do it for you ? Did you know that excel can execute this macro itself when you open the workbook ? More efficient I think. Edited April 13, 2005 by bshoenhair Link to comment Share on other sites More sharing options...
NSearch Posted April 14, 2005 Author Share Posted April 14, 2005 (edited) I did not know that you could do that. If you would, please advise me. Also, what do I need to add inbetween spaces in file names so that AutoIt picks them up as one word and not two. Thanks. Edited April 14, 2005 by NSearch Link to comment Share on other sites More sharing options...
bshoenhair Posted April 14, 2005 Share Posted April 14, 2005 I did not know that you could do that. If you would, please advise me.Also, what do I need to add inbetween spaces in file names so that AutoIt picks them up as one word and not two.Thanks.<{POST_SNAPBACK}>Are you familiar with Excel VBA IDE ? If not open your workbook then press ALT and F11. Find the code for your macro then cut and paste it in the "Private Sub Workbook_Open()" function.For spaces:Use FileGetShortName( "file" ) or enclose in extra quotes '"C:\some folder\some file.xls"' Link to comment Share on other sites More sharing options...
NSearch Posted April 14, 2005 Author Share Posted April 14, 2005 bshoenhair, Thank you for your reponse. When I use the extra set of quotes I get an error: Run (""C:\Program Files\ Microsoft Office\Office\EXCEL.EXE C:\fedxrem\upseinv analysis.xls"") Run(""C^ERROR Error:Unable to parse line. Link to comment Share on other sites More sharing options...
buzz44 Posted April 14, 2005 Share Posted April 14, 2005 (edited) Run ('C:\Program Files\Microsoft Office\Office\EXCEL.EXE "C:\fedxrem\upseinv analysis.xls"') Edited April 14, 2005 by Burrup qq 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