首页 文章

VBA Excel DLL - 错误48

提问于
浏览
0

我最近得到了一个基于2003 Office版本的VBA代码,基于32位 . 我只有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

将非常感谢帮助

1 回答

  • 0

    您似乎在为您的dll使用非标准名称 .

    有时,DLL过程的名称不是合法标识符 . 它可能包含无效字符,例如连字符 . 在这种情况下,使用Alias关键字指定非法过程名称 .

    欲了解更多信息,请参阅this article

相关问题