spiderkayak Posted January 12, 2009 Share Posted January 12, 2009 Hello, and made an Excel macro, I like to do in AutoIt. I attached visual programming, help me to see how:------------------------------------------------------------------------------Sub clientesexternos()Dim DIreccion As StringDim appIE As InternetExplorerSet appIE = New InternetExplorerappIE.AddressBar = FalseappIE.StatusBar = FalseappIE.MenuBar = FalseappIE.Toolbar = FalseappIE.Height = 300appIE.Width = 300appIE.Resizable = FalseappIE.Left = 120appIE.Top = 220appIE.Visible = False 'In this window returns a code indicating that the routine was prosecuted for the url and I need to save this information in a logRange("A2").Select 'nos paramos en A2While ActiveCell <> "" 'mientras que la celda esté llena:'concatenamos la URL completa con los parametros:DIreccion = "http://chile.sitmobile.com:8765/MT_ClienteExterno.aspx?Text=" & ActiveCell _& "&Destinations=" & ActiveCell.Offset(0, 1) _& "&Login=xxxxx" _& "&Password=xxxx" _& "&IdClient=xxxx" _& "&IdCuenta=xxxx" _& "&Remitente=" & ActiveCell.Offset(0, 10)'navegamos en la URL:appIE.Navigate DIreccionDo While appIE.BusyDoEventsLoop'pasamos a la celda siguiente y asi sucesivamente...:ActiveCell.Offset(1, 0).SelectApplication.Wait (Now + TimeValue("00:00:01"))Wend'cerramos la ventana de Internet explorer:appIE.QuitMsgBox "Proceso Finalizado", vbOKOnly, "CEM HTS"End Sub ------------------------------------------------------------------------------sending information to the URL is extracted from an Excel spreadsheet.thanksVictor Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 12, 2009 Share Posted January 12, 2009 Hello, and made an Excel macro, I like to do in AutoIt. I attached visual programming, help me to see how:------------------------------------------------------------------------------Sub clientesexternos()Dim DIreccion As StringDim appIE As InternetExplorerSet appIE = New InternetExplorerappIE.AddressBar = FalseappIE.StatusBar = FalseappIE.MenuBar = FalseappIE.Toolbar = FalseappIE.Height = 300appIE.Width = 300appIE.Resizable = FalseappIE.Left = 120appIE.Top = 220appIE.Visible = False 'In this window returns a code indicating that the routine was prosecuted for the url and I need to save this information in a logRange("A2").Select 'nos paramos en A2While ActiveCell <> "" 'mientras que la celda esté llena:'concatenamos la URL completa con los parametros:DIreccion = "http://chile.sitmobile.com:8765/MT_ClienteExterno.aspx?Text=" & ActiveCell _& "&Destinations=" & ActiveCell.Offset(0, 1) _& "&Login=xxxxx" _& "&Password=xxxx" _& "&IdClient=xxxx" _& "&IdCuenta=xxxx" _& "&Remitente=" & ActiveCell.Offset(0, 10)'navegamos en la URL:appIE.Navigate DIreccionDo While appIE.BusyDoEventsLoop'pasamos a la celda siguiente y asi sucesivamente...:ActiveCell.Offset(1, 0).SelectApplication.Wait (Now + TimeValue("00:00:01"))Wend'cerramos la ventana de Internet explorer:appIE.QuitMsgBox "Proceso Finalizado", vbOKOnly, "CEM HTS"End Sub ------------------------------------------------------------------------------sending information to the URL is extracted from an Excel spreadsheet.thanksVictorWelcome to AutoIt. Check out the _IE* functions in the help file for the MS IE management, and the _Excel* functions for excel. For example, you would use _IEPropertSet() for your "appIE.StatusBar = False". Try out the examples in the help file to start with.I don't see you opening Excel and I don't know how you get Range Select or ActiveCell from IE. So I don't understand that portion of your code. 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...
ResNullius Posted January 12, 2009 Share Posted January 12, 2009 I don't see you opening Excel and I don't know how you get Range Select or ActiveCell from IE. So I don't understand that portion of your code.C'mon Psalty, the OP's code is "an Excel Macro", so it's running when Excel is already open. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 12, 2009 Share Posted January 12, 2009 C'mon Psalty, the OP's code is "an Excel Macro", so it's running when Excel is already open. Doh! You're probably right. I saw "attached visual programming" and assumed he was talking an external program.Still, what he seems to be asking for is how to code it in AutoIt vice VBA, where he will have to open Excel to use those object references. 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...
spiderkayak Posted January 13, 2009 Author Share Posted January 13, 2009 Doh! You're probably right. I saw "attached visual programming" and assumed he was talking an external program.Still, what he seems to be asking for is how to code it in AutoIt vice VBA, where he will have to open Excel to use those object references. so is, I need to be able to guide me in building code AutoIt, Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 13, 2009 Share Posted January 13, 2009 so is, I need to be able to guide me in building code AutoIt,Have you done the first part with the _IE* functions yet? Try out the example scripts in the help file for _IECreate(), _IEPropertySet(), and _IENavigate().For the Excel portion, try out _ExcelBookOpen() and _ExcelReadCell().If you get stuck, post your code for more help. 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...
spiderkayak Posted January 15, 2009 Author Share Posted January 15, 2009 Have you done the first part with the _IE* functions yet? Try out the example scripts in the help file for _IECreate(), _IEPropertySet(), and _IENavigate().For the Excel portion, try out _ExcelBookOpen() and _ExcelReadCell().If you get stuck, post your code for more help. I could show an example, using these sentencesthanksVictor Link to comment Share on other sites More sharing options...
azure Posted January 15, 2009 Share Posted January 15, 2009 I could show an example, using these sentences thanks Victor There are examples in the help file is what he's told you twice now. _ExcelBookOpen(): #include <Excel.au3> $sFilePath1 = @ScriptDir & "\Test1.xls" ;This file should already exist $oExcel = _ExcelBookOpen($sFilePath1) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Shame on you!") Exit EndIfoÝ÷ Øæy«¢+Ø¥¹±Õ±Ðí%¹ÔÌÐì)}% ÉÑ ÅÕ½ÐíÝÝܹÕѽ¥ÑÍÉ¥Áй½´ÅÕ½Ðì°Ä°Ä°À¤)}% ÉÑ ÅÕ½Ðíµä¹å¡½¼¹½´ÅÕ½Ðì°Ä°Ä°À¤)}% ÉÑ ÅÕ½ÐíÝÝܹ½½±¹½´ÅÕ½Ðì°Ä°Ä°ÀoÝ÷ ØLzT^iÐV®¶sb6æ6ÇVFRfÇC´W6VÂæS2fwC° ¤Æö6Âb33c¶ôW6VÂÒôW6VÄ&öö´æWr´7&VFRæWr&öö²ÂÖ¶RBf6&ÆP ¥ôW6VÅw&FT6VÆÂb33c¶ôW6VÂÂgV÷C´w&÷FRFòF26VÆÂgV÷C²Âµw&FRFòFR6VÆÀ¢b33c·46VÆÅfÇVRÒôW6VÅ&VD6VÆÂb33c¶ôW6V¤×6t&÷ÂgV÷C²gV÷C²ÂgV÷CµFR6VÆÂfÇVR3¢gV÷C²fײ5$Äbfײb33c·46VÆÅfÇVRÂ" ¤×6t&÷ÂgV÷C´WFærgV÷C²ÂgV÷Cµ&W72ô²Fò6fRfÆRæBWBgV÷C²¥ôW6VÄ&ööµ6fT2b33c¶ôW6VÂÂFV×F"fײgV÷C²b3#µFV×çÇ2gV÷C²ÂgV÷C·Ç2gV÷C²Â²æ÷rvR6fRBçFòFRFV×F&V7F÷'²÷fW'w&FRW7FærfÆRbæV6W76'¥ôW6VÄ&öö´6Æ÷6Rb33c¶ôW6V²æBfæÆÇvR6Æ÷6R÷W@ 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