Imacros hangs during some operations

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++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:


Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Imacros hangs during some operations

by psenatori on Fri Oct 29, 2010 11:53 am

More of an answer then a question, but I've encountered some situations where imacros scripting edition just simply hangs (process is Not Responding). I've tried escaping these through imacro error codes (i call all macros from vbscript) and other "ping imacros" type of operatons, but none consistently worked. After some research in these forums and elsewhere, here's what I came up with. Hope it helps others who encounter a hung imacros process and need a remedy. As is typically the case with a Not Responding process situation, it's very difficult for someone else to
duplicate since it can involve other processes, memory usages and I/O issues occurring on my servers. Anyway, for others, here's the function....

Function ImacrosNotResponding
'Surprisingly, it took far long to figure this problem out given how short the code turned out to be. Pretty short and sweet,
'but all it does is check the process status of imacros and returns TRUE if the process is Not Responding
'or FALSE if the process is RUNNING (used this approach given my app needs. The function is called from locations
'where imacros has a tendency to hang
'or in convenient code locations where a process check (and possible soft-reset to a recovery url does not pose
'any application harm). I tried a number of other approaches, but couldn't really find the hung process state and still
'returned values indicated the process was live when it was actually Not Responding. By the way, I use a recovery_url
'approach quite often so I can always return the app to where it was prior to the imacros hanging.

Dim oExec
Set oExec = WScript.CreateObject("WScript.Shell").Exec("taskkill.exe /im imacros.exe /fi ""status eq not responding""")
if InStr(oExec.stdout.readall,"terminated") <> 0 then
' Not Responding
ImacrosNotResponding = True
' Process Still Running
ImacrosNotResponding = False
End If
End Function
Posts: 4
Joined: Fri Oct 29, 2010 11:35 am

Re: Imacros hangs during some operations

by Tom, Tech Support on Thu Nov 04, 2010 11:54 am

Very clever, thanks for sharing!

Tom, iMacros Support
Tom, Tech Support
Posts: 3300
Joined: Mon May 31, 2010 9:59 am

Re: Imacros hangs during some operations

by Kelicula on Wed Dec 24, 2014 12:05 pm

Indeed, very good, thank you!! I was having the same problem.
I did find it helpful to add the /f switch in my application however, since it wasn't responding, it didn't respond to the kill signal, however with that slight addition it works perfectly!
Code: Select all
Set oExec = WScript.CreateObject("WScript.Shell").Exec("taskkill.exe /f /im imacros.exe /fi ""status eq not responding""")
Posts: 7
Joined: Tue Oct 07, 2014 11:17 am

Re: Imacros hangs during some operations

by dboone21 on Fri Feb 26, 2016 10:32 am

Thanks for posting this. I have tried both versions (with and without the F switch) and can't get the object to set. (424 - Object required error.)
I'm using this in Excel VBA with iMacros
I have the function in a module, and the code in a different module. I'm calling the function with a simple If statement.

Code: Select all
If ImacrosNotResponding = False Then MsgBox "It's still good!"

Has anyone else tried this and had success, or are there any other ways to troubleshoot a hanging iMacros? I have code to search for a certain tag in my application that I'm hitting, and if it doesn't find the tag to close and start again, but that still passes sometimes if it's hanging as the tag is still "there".

Any help would be appreciated!
Posts: 1
Joined: Fri Feb 26, 2016 10:16 am

Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests