我需要输入必须填写代理表格的网站。我无法使用Selenium VBA来填写表格。
我从 VBA 调用了 VBS 脚本来填写表格。当电脑未未锁定时工作。
下面是代理表格。
调用VBS的Outlook VBA代码:
Dim bot as new chromedriver
bot.Start "chrome", "https://nissan.service-now.com/nav_to.do?uri=%2Fhome.do%3F"
bot.Get ("https://nissan.service-now.com/nav_to.do?uri=%2Fhome.do%3F") '//load webpage
strFileName = "d:\LocalData\Z018439\Desktop\MY\NX-AMO\VBACodes\Shell.vbs"
Set oshell = CreateObject("Wscript.shell")
oshell.Run "vbsc " & strFileName '//call vbs file
填写代理表格的VBS代码:
Sub test()
Dim shell_object
Dim app_path, time
wscript.Sleep 12000
shell_object = "wscript.shell"
Set objshell = CreateObject(shell_object)
objshell.SendKeys ""
objshell.SendKeys "{Tab}"
objshell.SendKeys ""
objshell.SendKeys "{Enter}"
End Sub
PC锁定时,键盘功能被禁用,因此sendkeys(VBS)不起作用。启动是在Outlook中收到新邮件后完成的。
PC锁定后,如何填写代理表格。