0

我们最近升级了一些 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)

自动化错误 无效的指针

我希望有人能指出一个简单的修复方法,这样我就不必完全重新编写代码!

提前致谢!

4

1 回答 1

0

我设法通过几个步骤解决了这个问题,老实说,我不确定哪个完全解决了问题的这个特定部分:

首先是运行 DYMO_Label_v.8_SDK_Installer

我还从最新的 Dymo Connect 切换到 DYMO Label v.8

然后我必须确保我们使用的 Barcode 字体是作为所有用户的管理员安装的,而不仅仅是特定的用户配置文件

最后,我认为这可能是问题所在,该软件正在寻找一个名为“Serial.label”的标签模板,我在我们的服务器上找到并复制并粘贴到软件正在寻找它的 C: 驱动器中。

我很高兴我不必重新编写代码!

于 2020-08-04T13:18:39.950 回答