【问题标题】:How to fill the text field on web-page of SharePoint?如何填写 SharePoint 网页上的文本字段?
【发布时间】:2019-09-16 10:08:08
【问题描述】:

我需要填写公司内部网站 SharePoint 上的文本字段。但是当我开始我的代码时,在填充我的值之前,下一个错误会引发:

运行时错误:自动化错误,调用的对象已与其客户端断开连接

请帮忙

Sub Authority()

Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True

ie.navigate "OurInternalSite"
While ie.Busy Or ie.ReadyState<>4:DoEvents:Wend

ie.document.getelementbyid("ComboBox29-input").Value = "My text"

End Sub

按钮代码

<input data-is-interactable="true" id="ComboBox29-input" class="ms-ComboBox-Input css-93" type="text" aria-expanded="false" aria-autocomplete="inline" role="combobox" spellcheck="false" autocapitalize="off" autocomplete="off" data-lpignore="true" value="">

【问题讨论】:

    标签: vba internet-explorer


    【解决方案1】:

    IE 会在更改安全区域时打开浏览器的新实例(例如,从 Internet 导航到 Intranet 时),因此您会丢失 IE 对象。您可以更改 IE 中的安全设置,IIRC InternetLocal intranet 必须具有相同的安全级别,或/和 enable protected mode 勾选。如果这不起作用,请尝试在custom level 中启用websites in less privileged web content zone can navigate into this zone

    【讨论】:

    • 抱歉,我可以在哪里启用它?
    • 在浏览器的设置中:Internet 选项 -> 安全 -> 您正在查看的是 Internet 和本地 Intranet 区域。
    猜你喜欢
    • 2016-09-20
    • 2014-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-02
    • 2021-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多