LOOP does not increase after loop

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
ray
Posts: 1
Joined: Tue Nov 30, 2010 2:56 pm

LOOP does not increase after loop

Post by ray » Sun Dec 05, 2010 3:23 pm

Dear all

Hope that someone could help me on the following. I have a VBA script that will first login to a stock quote system. After login, i run a loop referring to a table with stock code, i want the loop to retrieve stock details . However, when i run the script. my loop always refers to the first line of my table ("input.csv"), i don;t know where i have gone wrong, could someone give me some help? thanks

Ray

Below is my VBA script



Sub stocklookup()
'
' stocklookup Macro
'
'Option Explicit
Dim iim1, iret
Dim intLoop As Integer
'initialize iMacros instance
Set iim1 = CreateObject("imacros")
iret = iim1.iimInit()
'here comes the code - login
iret = iim1.iimPlay("login")
intLoop = 1
Do Until intLoop = 3
i = iim1.iimSet("LOOP", CStr(intLoop))
i = iim1.iimPlay("lookup")
intLoop = intLoop + 1
Loop
' tell user we're done
MsgBox "End."
' exit iMacros instance and quit script
iret = iim1.iimExit()
End Sub



<<<< Details of the "lookup" referred to above>>>>
VERSION BUILD=7101044
TAB T=3
FRAME F=0
WAIT SECONDS=1
SIZE X=1390 Y=917
SET !DATASOURCE input.csv
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
DS CMD=KEY X=734 Y=33 CONTENT={{!COL1}}
WAIT SECONDS=1
DS CMD=CLICK X=734 Y=33 CONTENT={ENTER}
WAIT SECONDS=1
DS CMD=CLICK X=510 Y=128 CONTENT=
WAIT SECONDS=1
DS CMD=CLICK X=510 Y=317 CONTENT=
WAIT SECONDS=1
DS CMD=CLICK X=510 Y=317 CONTENT={ENTER}
WAIT SECONDS=1
ONDIALOG POS=1 BUTTON=SAVE
ONDIALOG POS=2 BUTTON=YES
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

Re: LOOP does not increase after loop

Post by siniy » Fri Dec 10, 2010 11:43 am

Replace

Code: Select all

SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
with

Code: Select all

SET !DATASOURCE_LINE {{LOOP}}
I'd recommend that you renamed LOOP to counter or something.
Post Reply