You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Power Automate Desktop VBScript中使用Brother b-PAC打印时遇ActiveX错误

解决b-PAC SDK报错:ActiveX component can't create object: 'bpac.Document'

错误信息

C:\Users<my_username>\AppData\Local\Temp\Robin\bhjxs4u5rls.tmp(5, 2)
Microsoft VBScript运行时错误: ActiveX component can't create object: 'bpac.Document'

所用VBScript代码

Const sDataFolder = <path_to_templates>
DoPrint(sDataFolder & "%Template%")

Sub DoPrint(strFilePath)
    Set ObjDoc = CreateObject("bpac.Document")
    bRet = ObjDoc.Open(strFilePath)
    If (bRet <> False) Then
        ObjDoc.GetObject("name").Text = "%Name%"
        ObjDoc.StartPrint "", 0
        ObjDoc.PrintOut 1, 0
        ObjDoc.EndPrint
        ObjDoc.Close
    End If
    Set ObjDoc = Nothing
End Sub

排查解决步骤

  • 确认b-PAC SDK安装状态
    检查Brother b-PAC SDK是否完整安装,安装后务必重启Power Automate Desktop,确保组件被系统正确识别。

  • 手动注册bpac.dll组件
    打开管理员权限的命令提示符,根据系统架构执行对应命令:

    • 32位系统:regsvr32 "C:\Program Files\Brother bPAC3 SDK\bin\bpac.dll"
    • 64位系统:regsvr32 "C:\Program Files (x86)\Brother bPAC3 SDK\bin\bpac.dll"
      执行成功会弹出“DllRegisterServer在bpac.dll已成功”提示。
  • 匹配Power Automate运行架构
    打开Power Automate Desktop的设置,找到“运行时架构”选项。如果b-PAC是32位版本,就把运行时架构设为32位;64位SDK对应64位架构,避免因位数不兼容导致组件加载失败。

  • 提升流的运行权限
    右键点击当前Power Automate流,选择“属性”,勾选“以管理员身份运行此流”,避免权限不足无法访问ActiveX组件。

  • 检查模板文件路径
    确认sDataFolder的路径正确,%Template%替换后指向有效的.lbx模板文件,路径里别包含中文或特殊字符,防止文件打开失败引发连锁错误。

内容的提问来源于stack exchange,提问作者Lupilum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 02:27:22