【问题标题】:VBA Excel DLL - Error 48VBA Excel DLL - 错误 48
【发布时间】:2017-04-29 00:39:27
【问题描述】:

我最近获得了一段基于 2003 的 Office 版本并且基于 32 位的 VBA 代码。我只有 64 位 Office 2016,我将代码更新到下面 - 但是当我运行宏时,我得到一个“运行时错误 - 找不到文件”Swings4-2.dll”。即使我删除了文件扩展名仍然会弹出错误。DLL 文件与 XLS/XLSM 文件位于同一目录中,即使我引用了文件的完整目录 - 它仍然给我一个错误。

#If VBA7 And Win64 Then
    Private Declare PtrSafe Sub Swings Lib "Swings4-2.dll" (ByRef Par1 As Integer, ByRef Par2 As Integer, _
       ByRef Par3 As Single, ByRef Par4 As Single, ByRef Par5 As Single, ByRef Par6 As Single, _
       ByRef Par7 As Single, ByRef Par8 As Single, ByRef Par9 As Single, ByRef Par10 As Single, _
       ByRef Par11 As Single, ByRef Parl2 As Single, ByRef Parl3 As Single, ByRef Parl4 As Single)
#Else
    Private Declare Sub Swings Lib "Swings4-2.dll" (ByRef Par1 As Integer, ByRef Par2 As Integer, _
       ByRef Par3 As Single, ByRef Par4 As Single, ByRef Par5 As Single, ByRef Par6 As Single, _
       ByRef Par7 As Single, ByRef Par8 As Single, ByRef Par9 As Single, ByRef Par10 As Single, _
       ByRef Par11 As Single, ByRef Parl2 As Single, ByRef Parl3 As Single, ByRef Parl4 As Single)
#End If

我们将不胜感激

【问题讨论】:

标签: vba excel dll


【解决方案1】:

您的 dll 似乎使用了非标准名称。

有时,DLL 过程的名称不合法 标识符。它可能包含无效字符,例如连字符。什么时候 遇到这种情况,使用 Alias 关键字指定非法 过程名称。

更多信息请查看this article

【讨论】:

  • 过程名称是“swings”。 DLL 名称带有连字符。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-04-15
  • 2015-03-26
  • 2015-06-13
  • 1970-01-01
  • 1970-01-01
  • 2022-12-14
  • 1970-01-01
相关资源
最近更新 更多