iimInit and iimOpen always return -1

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
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
jairbj
Posts: 6
Joined: Mon Sep 14, 2015 10:14 pm

iimInit and iimOpen always return -1

Post by jairbj » Mon Sep 14, 2015 10:36 pm

Hi friends, I'm new to Scripting Interface but I'm getting an error calling iimInit or iimOpen.

The imacros browser opens and It always return -1, after that close the browse.

I'm trying to develop in vb.net but also with the supplied VBS/C#/C++ demos the same problem occurs.

I'm using windows 10.

VB.NET code:

Code: Select all

Imports Status = iMacros.Status
Imports System.Text

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        startIMacros()

    End Sub

    Private m_app As iMacros.App

    Private Sub startIMacros()
        Dim builder As New StringBuilder
        builder.Append("CODE:")
        builder.Append("SET !USERAGENT 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'")
        builder.Append("TAB T=1")
        builder.Append("TAB CLOSEALLOTHERS")
        builder.Append("URL GOTO=http://www.google.com")

        Const cmdTimeout = 60

        Dim s As iMacros.Status

        m_app = New iMacros.App

        s = m_app.iimOpen("", True)
        MsgBox("Return Code: " + CStr(s))

        s = m_app.iimPlayCode(builder.ToString, cmdTimeout)

        If s > 0 Then
            MsgBox("Macro completed ok")
        ElseIf s < 0 And s > -100 Then
            MsgBox("Interface problem: " + CStr(s))
        Else
            MsgBox("Macro problem: " + CStr(s))
        End If

        s = m_app.iimExit()

    End Sub

End Class
I also tried with "-runner" option and I get a -6 error (with iimRunner opened).

UPDATE:
I tried the same scripts in Windows XP and it run well.
So the problem may be related to Windows 10.
Any solution for windows 10?

I'll try in Windows 2008 R2 that will be my target OS and will post more information.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iimInit and iimOpen always return -1

Post by chivracq » Wed Sep 16, 2015 12:51 am

jairbj wrote:Hi friends, I'm new to Scripting Interface but I'm getting an error calling iimInit or iimOpen.

The imacros browser opens and It always return -1, after that close the browse.

I'm trying to develop in vb.net but also with the supplied VBS/C#/C++ demos the same problem occurs.

I'm using windows 10.

VB.NET code:

Code: Select all

Imports Status = iMacros.Status
Imports System.Text

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        startIMacros()

    End Sub

    Private m_app As iMacros.App

    Private Sub startIMacros()
        Dim builder As New StringBuilder
        builder.Append("CODE:")
        builder.Append("SET !USERAGENT 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'")
        builder.Append("TAB T=1")
        builder.Append("TAB CLOSEALLOTHERS")
        builder.Append("URL GOTO=http://www.google.com")

        Const cmdTimeout = 60

        Dim s As iMacros.Status

        m_app = New iMacros.App

        s = m_app.iimOpen("", True)
        MsgBox("Return Code: " + CStr(s))

        s = m_app.iimPlayCode(builder.ToString, cmdTimeout)

        If s > 0 Then
            MsgBox("Macro completed ok")
        ElseIf s < 0 And s > -100 Then
            MsgBox("Interface problem: " + CStr(s))
        Else
            MsgBox("Macro problem: " + CStr(s))
        End If

        s = m_app.iimExit()

    End Sub

End Class
I also tried with "-runner" option and I get a -6 error (with iimRunner opened).

UPDATE:
I tried the same scripts in Windows XP and it run well.
So the problem may be related to Windows 10.
Any solution for windows 10?

I'll try in Windows 2008 R2 that will be my target OS and will post more information.
jairbj wrote:Hi friends, I installed my imacros enterprise trial in windows 10 and the script interface don't work.

I tried with the VBS and VB6 provided examples and both returns -1 in iimopen and iiminit.

The most crazy thing is that iMacros browser open and closes and it returns -1.

I tried the same examples in windows xp and windows 2008 and in both they works great.

ANY suggestions?
There is no need to kind of spam the Forum by opening 2 Threads in 2 different Sub-Forums about the same Problem (current Thread was just perfect, except that you didn't mention which Version of the iMacros Browser you are using...) (without mentioning the 3rd Thread in which you posted about again the same Pb, but that's OK)... :roll:
Last edited by chivracq on Wed Sep 16, 2015 1:04 am, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
jairbj
Posts: 6
Joined: Mon Sep 14, 2015 10:14 pm

Re: iimInit and iimOpen always return -1

Post by jairbj » Wed Sep 16, 2015 12:54 am

chivracq wrote: There is no need to kind of spam the Forum by opening 2 Threads in 2 different Sub-Forums about the same Problem (current Thread was just perfect, except that you didn't mention which Version of the iMacros you are using...) (without mentioning the 3rd Thread in which you posted about again the same Pb, but that's OK)... :roll:
Hi friend, sorry for the misunderstanding.

I'm using the latest iMacros version 10.4.28.1074 x64.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: iimInit and iimOpen always return -1

Post by Tom, Tech Support » Wed Sep 16, 2015 9:33 am

jairbj wrote:I tried the same scripts in Windows XP and it run well.
So the problem may be related to Windows 10.
Any solution for windows 10?
Hi jairbj,

Our QA and development teams have not found any issues using the iMacros scripting interface on Windows 10 thus far.
Regards,

Tom, iMacros Support
rezuke
Posts: 3
Joined: Tue Oct 20, 2015 4:53 pm

Re: iimInit and iimOpen always return -1

Post by rezuke » Tue Oct 20, 2015 11:54 pm

I have the same issue when running it on windows server 2012. Can anyone please help me?
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: iimInit and iimOpen always return -1

Post by Tom, Tech Support » Wed Oct 21, 2015 12:59 pm

For anyone encountering this problem, would you please let us know if you have any anti-virus/malware software running on the machine.
Regards,

Tom, iMacros Support
hostile17
Posts: 12
Joined: Thu Sep 20, 2007 2:08 pm

Re: iimInit and iimOpen always return -1

Post by hostile17 » Fri Feb 12, 2016 9:25 pm

So disappointing to see someone who needs help told off for - shock horror - posting twice.

However no help is provided... and a spam bot is allowed to spam and without comment is left there for over four months!
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: iimInit and iimOpen always return -1

Post by chivracq » Sun Feb 14, 2016 4:32 am

hostile17 wrote:So disappointing to see someone who needs help told off for - shock horror - posting twice.

However no help is provided... and a spam bot is allowed to spam and without comment is left there for over four months!
Pfff...!, yep, nice talking for sbd who's been using iMacros for nearly 9 years and never bothered to answer one single Thread to help other Users and can't even follow up on his/her own Threads a bit neatly, like this Thread which has been waiting for more than 8 years for some Follow-up/mini-Thanks from you...! :roll:

Concerning Current Thread, yep, sorry, "spamming" the Forum by opening several identical Threads is not the way to use the (sorry: any) Forum correctly as Info in Replies then get scattered in different Threads and renders each Thread a bit useless for other Users with a similar Pb to follow...
And TechSupport replied twice in this Thread but OP didn't follow up...

So..., not sorry at all for "disappointing" you, come and join helping us answering Questions from other Users and you will get some joy in your Life... :idea: 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply