Jump to content

Excel macro to AutoIt, Help!


Recommended Posts

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 String

Dim appIE As InternetExplorer

Set appIE = New InternetExplorer

appIE.AddressBar = False

appIE.StatusBar = False

appIE.MenuBar = False

appIE.Toolbar = False

appIE.Height = 300

appIE.Width = 300

appIE.Resizable = False

appIE.Left = 120

appIE.Top = 220

appIE.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 log

Range("A2").Select 'nos paramos en A2

While 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 DIreccion

Do While appIE.Busy

DoEvents

Loop

'pasamos a la celda siguiente y asi sucesivamente...:

ActiveCell.Offset(1, 0).Select

Application.Wait (Now + TimeValue("00:00:01"))

Wend

'cerramos la ventana de Internet explorer:

appIE.Quit

MsgBox "Proceso Finalizado", vbOKOnly, "CEM HTS"

End Sub

------------------------------------------------------------------------------

sending information to the URL is extracted from an Excel spreadsheet.

thanks

Victor

Link to comment
Share on other sites

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 String

Dim appIE As InternetExplorer

Set appIE = New InternetExplorer

appIE.AddressBar = False

appIE.StatusBar = False

appIE.MenuBar = False

appIE.Toolbar = False

appIE.Height = 300

appIE.Width = 300

appIE.Resizable = False

appIE.Left = 120

appIE.Top = 220

appIE.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 log

Range("A2").Select 'nos paramos en A2

While 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 DIreccion

Do While appIE.Busy

DoEvents

Loop

'pasamos a la celda siguiente y asi sucesivamente...:

ActiveCell.Offset(1, 0).Select

Application.Wait (Now + TimeValue("00:00:01"))

Wend

'cerramos la ventana de Internet explorer:

appIE.Quit

MsgBox "Proceso Finalizado", vbOKOnly, "CEM HTS"

End Sub

------------------------------------------------------------------------------

sending information to the URL is extracted from an Excel spreadsheet.

thanks

Victor

Welcome to AutoIt. :o

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

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

C'mon Psalty, the OP's code is "an Excel Macro", so it's running when Excel is already open. :D

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.

:o

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

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.

:o

:D

so is, I need to be able to guide me in building code AutoIt,

Link to comment
Share on other sites

:)

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.

:o

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

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 sentences

thanks

Victor

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...