我们最近升级了一些 PC,随后在用于对 MySQL 数据库执行操作的 Access 前端中遇到了 VBA 代码的一些问题。特定代码从数据库中提取序列号,然后将其作为条形码打印到 Dymo Labelwriter 450。
Style = vbExclamation + vbYesNo
Title = "Print Label For " & Me.txt_Barcode & " ?"
Response = MsgBox("Do you want to print a label for serial number " & Me.txt_Barcode, Style, Title)
If Response = vbYes Then
Dim myDymo As Object
Dim myLabel As Object
'On Error Resume Next
Set myDymo = CreateObject("Dymo.DymoAddIn") '
Set myLabel = CreateObject("Dymo.DymoLabels")
If (myDymo Is Nothing) Or (myLabel Is Nothing) Then
MsgBox "Unable to create OLE objects"
Exit Sub
End If
代码现在在第 8 行中断,即
Set myDymo = CreateObject("Dymo.DymoAddIn") '
我得到的错误代码与 ActiveX 有关(这似乎可能与从 32 位到 64 位有关),但自从安装了 Dymo 的最新 DLS(DLS8Setup.8.2.2.996)后,它似乎有演变为以下:
运行时错误'-2147467261 (80004003)
自动化错误 无效的指针
我希望有人能指出一个简单的修复方法,这样我就不必完全重新编写代码!
提前致谢!