Help to run macro from excel

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
samihantash
Posts: 3
Joined: Mon May 16, 2011 2:20 pm

Help to run macro from excel

Post by samihantash » Wed May 18, 2011 6:22 am

Hi All,

I would like to ask for your help to build a simple macro, I'm not an expert that why I was not able to make a macro ruining.
As i am not expert i was not able to build it according the 2 examples below:
http://wiki.imacros.net/File-2-Web.vbs
http://wiki.imacros.net/File-2-Web-Method2.vbs


I have a datasource file were cell A = 1 or 2

the 2 macro are (Part of it which i face problem with)
1.iim
TAB T=1
SET !DATASOURCE datasourcewo.csv
SET !DATASOURCE_COLUMNS 20
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:RADIO FORM=ID:viewns_7_N11C00H2_:inputform ATTR=VALUE:reasonCode CONTENT=YES

2.iim
TAB T=1
SET !DATASOURCE datasourcewo.csv
SET !DATASOURCE_COLUMNS 20
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:RADIO FORM=ID:viewns_7_N11C00H2_:inputform ATTR=VALUE:manual CONTENT=YES

The code i have in excel is:
Option Explicit

Dim iim1, i, iret
Set iim1 = CreateObject("imacros")
iret = iim1.iimInit
If Range("A1") = ("1") Then
iret = iim1.iimPlay("1")
End If
If Range("A1") = ("2") Then
iret = iim1.iimPlay("2")
End If
iret = iim1.iimExit

End Sub

What i would like is if cell in column A = 1 run macro 1.iim if cell in column A = 2 run macroo 2.iim

Thank you
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

Re: Help to run macro from excel

Post by siniy » Tue May 24, 2011 9:47 pm

well, your request is too complicated to understand
Tom, Tech Support
Posts: 3614
Joined: Mon May 31, 2010 4:59 pm

Re: Help to run macro from excel

Post by Tom, Tech Support » Wed May 25, 2011 8:56 am

Try the following code in your Excel script:

Code: Select all

Option Explicit

Dim iim1, i, iret
Set iim1 = CreateObject("imacros")
iret = iim1.iimInit
iret = iim1.iimPlay(Cells(1, 1).Value)
iret = iim1.iimExit

End Sub
Regards,

Tom, iMacros Support
Post Reply