【问题标题】:Accessing DLLs through VBA通过 VBA 访问 DLL
【发布时间】:2011-08-14 21:54:02
【问题描述】:

如何从 VBA (Excel) 访问第三方 DLL 中的函数?另外,有没有办法查看 DLL 中所有可用的函数?

【问题讨论】:

    标签: excel vba dll


    【解决方案1】:

    要调用第三方 DLL 中的函数,需要使用 Declare 语句。例如:

    Private Declare Function GetTempPath Lib "kernel32" _
         Alias "GetTempPathA" (ByVal nBufferLength As Long, _
         ByVal lpBuffer As String) As Long
    

    有关详细信息,请参阅 MSDN 上的 How to: Access DLLs in Excel


    要列出可用的函数,请查看Dependency Walker 工具,该工具将列出从 DLL 导出的函数(以及许多其他信息)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多