简体   繁体   English

为什么我的代码会引发错误“ ActiveX组件无法创建对象”

[英]Why does my code throw an error “ActiveX component can't create object”

Sub imacros()
Dim iim1, iret

  Set iim1 = CreateObject("imacros")
  iret = iim1.iimInit("", True)

 Dim macro
 macro = "CODE:"
 macro = macro + "'Uses a Windows script to submit several datasets to a website, e. g. for filling an online database" + vbNewLine
 macro = macro + "' Specify input file (if !COL variables are used, IIM automatically assume a CSV format of the input file" + vbNewLine
 macro = macro + "'CSV = Comma Separated Values in each line of the filE" + vbNewLine
 macro = macro + "TAB T=1" + vbNewLine
 macro = macro + "SET !DATASOURCE C:\Users\Desktop\test\test.csv" + vbNewLine
 macro = macro + "'Start at line 2 to skip the header in the file" + vbNewLine
 macro = macro + "'Increase the current position in the file with each loop " + vbNewLine
 macro = macro + "' Fill web form " + vbNewLine
 macro = macro + "TAB T=1" + vbNewLine
 macro = macro + "TAB CLOSEALLOTHERS" + vbNewLine
 macro = macro + "SET !PLAYBACKDELAY 0.2" + vbNewLine
 macro = macro + "URL GOTO=secured URL here" + vbNewLine
 macro = macro + "TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:name CONTENT={{!COL1}}" + vbNewLine
 macro = macro + "TAG POS=1 TYPE=INPUT:SUBMIT ATTR=TYPE:submit" + vbNewLine
 macro = macro + "TAG POS=1 TYPE=TABLE ATTR=CLASS:standardTable EXTRACT=TXT" + vbNewLine
 macro = macro + "SAVEAS TYPE=EXTRACT FOLDER=""C:\Users\Desktop\test"" FILE=""test_image.csv""" + vbNewLine
 macro = macro + "" + vbNewLine

 iret = iim1.immPlay(macro)

End Sub

Above is the code that im using. 上面是即时通讯使用的代码。 Could someone please let me know if there is something wrong with that and the reason for error? 有人可以让我知道这是否有问题以及错误的原因吗? * Converted the code from imacros using iMacros Scripting Code Creator to VBS string *使用iMacros脚本代码创建器将代码从imacros转换为VBS字符串

This line might have wrong quotation marks: 该行可能带有错误的引号:

macro = macro + "URL GOTO="secured URL here" + vbNewLine

You can see it here, as the next line is marked as a string: 您可以在这里看到它,因为下一行被标记为字符串:

macro = macro + "URL GOTO="secured URL here" + vbNewLine
macro = macro + "TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:name CONTENT={{!COL1}}" + vbNewLine

Remove the quotation mark after the equal sign and try again. 删除等号后的引号,然后重试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 脚本在调试模式下工作,但在正常运行下不工作-错误代码:429(ActiveX组件无法创建对象) - Script working in Debug Mode but not in Normal Run - Error Code: 429(ActiveX Component Can't Create Object') ActiveX组件无法创建对象VBA运行时错误 - ActiveX component can't create object VBA runtime error 为什么每隔几次迭代都会出现此错误? “ ActiveX组件无法创建对象” - Why do I get this error every few iterations? 'ActiveX Component Can't Create Object' Excel 中的“ActiveX 组件无法创建对象”错误 - “ActiveX component can't create object” Error in Excel activex组件无法使用word.application创建对象错误 - activex component can't create object error with word.application ActiveX 组件无法创建 object - 429 - ActiveX component can't create object - 429 创建Outlook对象会生成-运行时错误'429':ActiveX组件无法创建对象 - Creating Outlook object generates - Run-time error '429': ActiveX component can't create object 所有对象都会显示错误消息“ActiveX组件无法创建对象” - Error message “ActiveX component can't create object” appears for all objects 从 Excel 发送邮件 - 运行时错误“429”:ActiveX 组件无法创建对象 - Sending mails from Excel - Run-time error '429': ActiveX component can't create object VBA:Acrobat运行时错误429; ActiveX组件无法创建对象 - VBA: Acrobat Run time error 429; ActiveX component can't create object
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM