vba - 编写脚本时出现活动内容错误
问题描述
在 SAP 中编写脚本时出现活动内容通知的问题。我的 IE 的 ActiveX 设置被设置为允许 ActiveX 内容。仅当通过脚本设置 SAP 连接时才会出现问题。以下是我遇到问题的代码部分。通过脚本打开也会导致显示不同的 SAP 视图,这可能是问题的一部分。是否有其他方法可以打开 SAP 以避免活动内容通知?
'***** Open SAPGUI
Set objShell = CreateObject("WScript.Shell")
objShell.exec "C:\Program Files (x86)\SAP\frontend\sapgui\saplgpad.exe"
Application.Wait (Now + TimeValue("0:00:03"))
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set Application1 = CreateObject("Sapgui.ScriptingCtrl.1")
Set SAPGUI = GetObject("SAPGUI")
'***** Start Script Engine (disable pop up in SAP settings if applicable or will get error)
Set Application1 = SAPGUI.GetScriptingEngine
If SAPguiAPP Is Nothing Then
Set SAPguiAPP = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If Connection Is Nothing Then
Set Connection = SAPguiAPP.OpenConnection("1C. SAP ECC Production")
End If
If Session Is Nothing Then
Set Session = Connection.Children(0)
End If
解决方案
推荐阅读
- javascript - 分数卡在一个
- java - 对来自 jar 的实体应用 ehCache
- image-processing - 如何进行路面纹理微观或宏观尺度的 3D 重建?
- c# - 无法让我的玩家移动脚本工作
- javascript - 我想在 fastify 路由中使用模式,但它返回空对象,但如果我评论模式代码,它工作正常
- python - 如果页面未发布,请转到下一个可用页面
- php - 在 2 个自定义帖子类型之间创建关系
- javascript - 如何在节点中的 process.exit 之后启动另一个进程
- sql - 按 ID 统计记录数
- passport.js - PassportJS 和 OKTA saml - 打开登录页面时,护照用我的域替换 okta 域