Using VBA and iMacros to take data from Excel Sheet to fill

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 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:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

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.

Using VBA and iMacros to take data from Excel Sheet to fill

by jinhui on Thu Oct 26, 2017 2:39 am

I have some error while running the VBA and the error code 429, ActiveX component can't create object, appears.

Code: Select all
Option Explicit

 
   Private Sub CommandButton2_Click()
   
   MsgBox "Reads data row from an Excel sheet and submit this information to a website."
   
   Dim imacro, iret, row, totalrows
   
   Set imacro = CreateObject("imacros")
   
   iret = imacro.iimInit
   'Firefox iret = test.iimInit ("-fx")
   iret = imacro.iimDisplay("Submitting Data from Excel")
   
   totalrows = ActiveSheet.UsedRange.Rows.Count
   For row = 2 To totalrows
      'Set the variables
      iret = imacro.iimSet("Short-Name*", Cells(row, 1).Value)
      iret = imacro.iimSet("Acct-Cntr-Type*", Cells(row, 2).Value)
      iret = imacro.iimSet("Base-Ccy*", Cells(row, 3).Value)
      'Set the display
      iret = imacro.iimDisplay("Row# " + CStr(row))
      'Run the macro
      iret = imacro.iimPlay("test.iim")
      If iret < 0 Then
         MsgBox imacro.iimGetLastError()
      End If
   Next row
   
   iret = imacro.iimDisplay("Submission complete")
   iret = imacro.iimExit

End Sub


The error occurs at test = CreateObject("test") stating that test=empty.

Is there any code I am missing out?

I am running on Firefox 47.0 and iMacro for Firefox 8.9.7. I am also running on Windows 7.
jinhui
 
Posts: 9
Joined: Wed Oct 04, 2017 3:05 am

Re: Using VBA and iMacros to take data from Excel Sheet to f

by senor pengwin on Sat Jul 14, 2018 12:21 am

Code: Select all
iret = imacro.iimPlay("test.iim")


This line declares the name of your IMacro file, it appears as it if cannot find the saved IMacro file. Make sure you have an IMacro named "test.iim" in the default macro saves folder. If you have the file inside another folder inside the default path you will need to include that as well.

Code: Select all
iret = imacro.iimPlay("Foldername\test.iim")
senor pengwin
 
Posts: 32
Joined: Thu Aug 17, 2017 3:33 pm

Re: Using VBA and iMacros to take data from Excel Sheet to f

by aegorhum on Tue Jul 17, 2018 11:14 am

Why are you commenting out the second line here? Also, why do you have firefox in front of it?
Code: Select all
   iret = imacro.iimInit
   'Firefox iret = test.iimInit ("-fx")
   iret = imacro.iimDisplay("Submitting Data from Excel")


Try this?

Code: Select all
   iret = imacro.iimInit
   iret = test.iimInit ("-fx")
   iret = imacro.iimDisplay("Submitting Data from Excel")


Or this?
Code: Select all
Dim iim1, iret
set iim1 = CreateObject ("imacros")
iret = iim1.iimOpen("-fx")
aegorhum
 
Posts: 7
Joined: Mon Jul 09, 2018 1:31 pm


Return to Command Line and Scripting Interface

Who is online

Users browsing this forum: No registered users and 6 guests

-->