In the business I work for, we use iMacros to automate a lot of the day to day processes (mainly copy/pasting data into a website and submitting as well as page navigation; however IE is about to be removed as support for it is being ended. We've upgraded to the Chrome version, have the Enterprise license etc. but are now experiencing difficulties. I honestly thought it would just involve updating the odd line of code so imacros opened Chrome instead of IE but it doesn't appear that way anymore.
We use it in conjunction with a lot of vba enabled spreadsheets and whilst we've been using IE, everything has been running fine without problems. With the switch to Chrome, we're finding every time a macro is ran from Excel, it will open a new instance of iMacros as well as a new Chrome browser despite both being open at the time and the best of my knowledge, the vba is correct (it doesn't have this behaviour in IE).
I thought I could try and re-record some of the imacros, to see if there was differences but the recorder only logs the first line (which is the url of the page I'm on) and none of the button clicks etc.
We're also experiencing problems where lines of code don't seem to work anymore (like SET !MARKOBJECT NO seems to generate an error that the macro can't ignore even though SET !EVENTIGNORE YES is in place). Again, this worked fine in IE.
Current version of iMacros for Chrome is v12.6 (64 bit) (Version build 10.1.0.1465 I think)
Current Chrome version is 101.0.4951.54 (Official Build) (64-bit)
Current version of Windows 10 (version 21H2 - OS build 19044.1645)
The demo macros work but open a new instance of imacros and chrome browser each time they're ran.
Unfortunately I can't provide a link to the website as you need to be logged in to view (plus it's full of sensitive data).
As mentioned above, many of the imacros have been created by previous employees, been cannibalised from reading up on what others have done or recording and working out how to do things for myself.
This is the vba from one such example:
Code: Select all
Sub Entdat_ANDY()
Dim s As Integer
Dim e As Integer
Dim ans As Integer
Dim ans2 As Integer
s = 0
e = 0
'On Error GoTo errhndlr
If MsgBox("Before you click yes to enter data" & vbNewLine & "make sure PP is logged in and" _
& vbNewLine & "Imacros is open", vbOKCancel, "SHIP TASK") = vbCancel Then
Exit Sub
End If
Dim iim1, iret, row, totalrows
Set iim1 = CreateObject("imacros")
'iret = iim1.iimOpen("-ie", False, 300)
iret = iim1.iimOpen("-cr", False, 300)
iret = iim1.iimDisplay("Submitting Data from Excel")
iret = iim1.iimPlay("PP Orders Screen-cr")
totalrows = ActiveSheet.UsedRange.Rows.Count
For row = 7 To totalrows
If Cells(row, 1).Value <> "" Then
'Set the variables
iret = iim1.iimSet("Ponum", Cells(row, 2).Value)
iret = iim1.iimSet("Startdate", Cells(row, 3).Value)
iret = iim1.iimSet("Enddate", Cells(row, 4).Value)
iret = iim1.iimSet("Line1", Cells(3, 7).Value)
'Set the display
iret = iim1.iimDisplay("Row# " + CStr(row))
'Run the macro
iret = iim1.iimPlay("PP Attachment Ship-cr") <---this stage always errors then moves onto Attachment Submit below
'On error run the Imacro error dump for the row
iret = iim1.iimPlay("PP Attachment Submit-cr") <---this works fine
'iret = iim1.iimPlay("PP Job Detail Return to Enter-cr")
iret = iim1.iimPlay("Orders tab")
iret = iim1.iimSet("OtherStartDate", Cells(2, 7).Value)
iret = iim1.iimSet("Ponum", Cells(row, 2).Value)
iret = iim1.iimSet("StartDate", Cells(row, 6).Value)
iret = iim1.iimSet("Pattern", Cells(row, 5).Value)
iret = iim1.iimPlay("PP Job Details-cr")
Code: Select all
VERSION BUILD=9002379
TAB T=1
'TAB CLOSEALLOTHERS
URL GOTO=https:// (web address removed)
TAG POS=1 TYPE=DIV ATTR=TXT:DDD<SP>iSupplier<SP>Portal<SP>Administrator<SP>(Create<SP>and<SP>View)
TAG POS=1 TYPE=DIV ATTR=TXT:DDD<SP>iSupplier<SP>Portal<SP>Administrator<SP>(Create<SP>and<SP>View)
TAG POS=1 TYPE=A ATTR=TXT:Orders
Code: Select all
VERSION BUILD=9002379
SET !ERRORIGNORE YES
SET !MARKOBJECT NO
TAG POS=1 TYPE=A FORM=NAME:DefaultFormName ATTR=TXT:Shipments
TAG POS=1 TYPE=A ATTR=TXT:Create<SP>Advance<SP>Shipment<SP>Notices
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:DefaultFormName ATTR=NAME:Value_1 CONTENT={{Ponum}}
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=NAME:DefaultFormName ATTR=TXT:Go
TAG POS=1 TYPE=SPAN FORM=NAME:DefaultFormName ATTR=TXT:{{Line1}}
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:DefaultFormName ATTR=NAME:ShipmentTable:selected:0 CONTENT=YES
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=NAME:DefaultFormName ATTR=ID:PosAsnAddToCart
TAG POS=1 TYPE=A FORM=NAME:DefaultFormName ATTR=TXT:Shipment<SP>Header
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:DefaultFormName ATTR=NAME:ShipNumEntry CONTENT={{Ponum}}-1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:DefaultFormName ATTR=NAME:ShipDateEntry CONTENT={{Startdate}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:DefaultFormName ATTR=NAME:ExpRcptDateEntry CONTENT={{Enddate}
Hopefully I haven't missed anything; any help would be greatly appreciated!
Pete.