gpt4 book ai didi

Excel Visual Basic 变量作为 HTMLDocument

转载 作者:行者123 更新时间:2023-12-02 22:32:46 25 4
gpt4 key购买 nike

一位用户向我发送了一个不再有效的宏,并且开发人员已经退休。当我查看变量时,其中一个声明如下:

Public WebDoc As HTMLDocument

当我运行宏时,它在下面的行中出错:

For p = 1 To y

vWBCount = Workbooks.Count

With ExpApp

.navigate vPath

Do Until .readyState = READYSTATE_COMPLETE
MyTimer
Loop

Set WebDoc = .document ''''THIS IS THE LINE THROWING THE ERROR

For Each IElem In WebDoc.forms(0).elements

Select Case IElem.Name
Case "InputKeys_BUSINESS_UNIT"
IElem.Value = vBU(p)

Case "InputKeys_bind2"
IElem.Value = vBegDate

Case "InputKeys_bind3"
IElem.Value = vEndDate

Case "InputKeys_VENDOR_ID"
IElem.Value = vVendor(p)

End Select
Next

.navigate vSubmit

Do Until .readyState = READYSTATE_COMPLETE
Call LookForAndCloseIEPopup
MyTimer
Loop

错误消息显示:

Object library feature not supported

任何有关如何解决此问题的建议将不胜感激。该宏正在 Windows 7/Office 2010/Visual Basic 上运行。

谢谢......

最佳答案

使用 .readyState = 4 而不是 .readyState = READYSTATE_COMPLETE。它们引用相同的readyState状态。

关于Excel Visual Basic 变量作为 HTMLDocument,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45825995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com