OS windows 8 64b
Firefox 31.0
My iMacro ver:
Macros Browser (x86) Version 10.0.2.2823
Enterprise Edition
Released on 27 May 2014
Addon ver:
iMacros For Firefox 8.8.2
Last updated July 14, 2014
Scripting language:
Excel 2013 VBA
Early binding to iimInterface.dll
Architecture:
using excel to create, open and execute several commands via Firefox instance to a trading platform
The problem:
while running the script to download a file the iMacro object in the VBA code lose connection to the firefox browser after downloading successfully the file inside the same procedure, any attempt to execute anything using the iMacro object right after reaches a timeout as if the iMacros stuck for good.
The code:
Code: Select all
If obj_iMacro Is Nothing Then Set obj_iMacro = CreateObject("iMacros")
' open firefox
iret = obj_iMacro.iimOpen("-fx -fxProfile " & ActiveUser.Profile, False)
' add user name to FF instance
iret = obj_iMacro.iimDisplay(ActiveUser.FullName)
' login user
Call usrLogin
'Clear Old File
sbDeletetingAFile "c:\tmp\" & ActiveUser.Account & "_Portfolio.csv"
iMacro = ""
iMacro = "TAG POS=2 TYPE=A ATTR=TXT:Portfolio" + vbNewLine
iMacro = iMacro + "ONDOWNLOAD FOLDER=c:\tmp FILE=" & ActiveUser.Account & "_Portfolio.csv WAIT=YES" + vbNewLine
iMacro = iMacro + "TAG POS=1 TYPE=A ATTR=TXT:Export<SP>to<SP>Excel" + vbNewLine
iret = obj_iMacro.iimPlayCode(iMacro)
'check for error
If iret < 0 Then
' show error msg
MsgBox "Cant execute FF macro in sub: Portfolio " & ActiveUser.FullName
Stop
End If
' THIS NOW RETURNS AN ERROR -3 "Error while receiving response"
Chk = "ADD !EXTRACT {{!URLCURRENT}}" + vbNewLine
iret = obj_iMacro.iimPlayCode(Chk, 10)
If iret = "-3" Then Stop
URL = obj_iMacro.iimGetExtract()
Please advice as i'm totally lost now
Thank you all in advance!!!
Best,
R.