IDispatch error, iMacros scritping with python

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
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
ilcaa728
Posts: 13
Joined: Fri Jun 27, 2014 8:01 pm

IDispatch error, iMacros scritping with python

Post by ilcaa728 » Sun Jan 03, 2021 3:30 pm

i am using 3.7 version of python to use the iMacros API for scripting. i continue to get this error message even though i have pywin32 installed. i am running a portable version of python, but it is registered locally... i created a portable version of my scripting edition of iMacros to move between computers via a usb... do you think this is what is causing the problem??

is it possible to run a portable version of the scripting edition?

error: pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

Code: Select all

#set up imacros
        w= win32com.client.Dispatch("imacros")
        w.iimOpen("", False)
             
#go to the trading model url, extract data         
        w.iimSet("url", url)
        w.iimPlay('TS_early_models')
Tom, Tech Support
Posts: 3682
Joined: Mon May 31, 2010 4:59 pm

Re: IDispatch error, iMacros scritping with python

Post by Tom, Tech Support » Mon Jan 04, 2021 8:57 am

Hi ilcaa728,
ilcaa728 wrote:
Sun Jan 03, 2021 3:30 pm
i created a portable version of my scripting edition of iMacros to move between computers via a usb... do you think this is what is causing the problem??

Yes, that is most likely the issue, depending on how exactly you created a 'portable' version. The scripting interface libraries (DLLs) as well as other essential libraries need to be registered on the system in order for all the functionality to be available. Typically, the iMacros installer does all this automatically. So it's not really possible to create a true portable version of the iMacros Enterprise/ scripting edition because these key components have to be registered on the machine.
Regards,

Tom, iMacros Support
ilcaa728
Posts: 13
Joined: Fri Jun 27, 2014 8:01 pm

Re: IDispatch error, iMacros scritping with python

Post by ilcaa728 » Mon Jan 04, 2021 10:28 pm

thanks for the reply. yes your correct. once i installed to local machine, it worked as expected.
Post Reply