vba - 在 VBA 中使用 dll 中的函数时出现运行时错误 48?
问题描述
我必须在 VBA 代码中使用 DLL 文件。
在代码中声明后,我无法使用或调用该函数。错误是:file not found
并且错误代码是runtime 48
。
我需要的帮助是知道如何调用和初始化 dll 中的函数。
Option Explicit
Public x As Integer
Private Declare Function XYZ Lib " H:\google drive\laser machine\software\Development\delete\squareDLL\x64\Debug\squareDLL.dll" (ByVal x As Double) As Double
Sub main()
x = 20
Call XYZ(x)
End Sub
解决方案
Option Explicit
Public x As Integer
Private Declare Function XYZ Lib " H:\google drive\laser machine\software\Development\delete\squareDLL\x64\Debug\squareDLL.dll" (ByVal x As Double) As Double
Sub main()
x = 20
Call XYZ(x)
End Sub
推荐阅读
- swift - LaunchScreen 不显示标签?
- r - R中简单线性回归和预测的迭代
- flutter - 如何将未来传递给 Flutter 中的类构造函数?
- sql - 创建列以获取每个唯一 ID 列的唯一计数
- android - Android - Kotlin - 预填充房间数据库
- apache - 从 example.com/foo.php 永久重定向到 example.com/foo 分别从 example.com/foo.php 到 example.com/bar
- reactjs - 续集 Op.like 和 Op.or 失败
- spring - Spring @Scheduled cron 作业
- r - 如何按 R 中的特定元素编号对数据框中的元素进行分组?
- java - 从 Soap Envelope 获取 X509 证书别名