【问题标题】:Play(Loop) Imacro from Excel VBA and put the Max Value in IMacro for playing Loop从 Excel VBA 播放(循环)Imacro 并将最大值放入 IMacro 以播放循环
【发布时间】:2016-05-06 10:56:05
【问题描述】:
Dim iim1, iret
Set iim1 = CreateObject("imacros")
iret = iim1.iiminit("-fx")
iret = iim1.iimplay("PayU_Refunds")
iret = iim1.iimDisplay("Done!")
iret = iim1.iimClose()

我想使用 Play(Loop) 而不是“iimplay”,并且还想将值放在 imacro 的“MAX”框中,来自 excel vba,这可能吗?如果是,请建议代码。

【问题讨论】:

  • 查看如何循环数字here的示例。

标签: excel imacros vba


【解决方案1】:

我认为你可以做的是直接在Excel中制作循环,多次播放iMacro:将iMacro中的变量{{!LOOP}}更改为{{loop}}然后使用iimSet("loop", i)设置值每次播放时循环播放。

应该是这样的:

Dim iim1, iret
Set iim1 = CreateObject("imacros")
For i = 1 To 5
    iret = iim1.iiminit("-fx")
    iret = iim1.iimSet("loop", i)
    iret = iim1.iimplay("PayU_Refunds")
Next i
iret = iim1.iimDisplay("Done!")
iret = iim1.iimClose()

目前无法在 Excel 中对其进行测试,但请试一试,如果可行,请告诉我们 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多