简体   繁体   English

暂停运行第三方加载项

[英]Pause to run third-party add-on

I broke a macro into 2 parts so that it could pause and use a third-party add-on to look up stock symbol descriptions. 我将宏分为两部分,以便可以暂停并使用第三方加载项来查找股票代码描述。 Some tickers don't have descriptions and the add-on returns "NTFND" if this is the case. 有些代码没有说明,并且在这种情况下,附件返回“ NTFND”。 I can find an alternate description for those securities but I need the formulas from the add-on to run to identify them. 我可以找到这些证券的替代描述,但是我需要使用附加组件中的公式来进行识别。 This works if I run Step1 and then Step2 separately. 如果我分别运行Step1和Step2,则此方法有效。

Sub Macro1()

Application.ScreenUpdating = False

Call Step1 'enters info from holdings sheet including ticker symbols

Application.Calculate

Call Step2 'fixes all the "Not Found" descriptions

Application.ScreenUpdating = True

End Sub

I tried the calculate function but it doesn't seem to calculate for the third-party add-on formulas. 我尝试了calculate函数,但似乎无法为第三方附加公式进行计算。 Is there another way I can have my Macro pause until the description formulas have run? 有没有其他方法可以让我的宏暂停,直到描述公式运行完毕?

I just tried 我刚试过

Application.Wait (Now + TimeValue("00:00:05"))

and

If Not Application.CalculationState = xlDone Then DoEvents End If

Neither worked. 两者都不起作用。

Application.Wait will indeed pause (for 5 sec in this case) until the next line of code being execute. Application.Wait确实会暂停(在这种情况下为5秒钟),直到执行下一行代码为止。

This might be what you are looking for: 这可能是您要寻找的:

cpearson.com/excel/ShellAndWait.aspx cpearson.com/excel/ShellAndWait.aspx

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM