1 %~dp0regasm.exe %~dp0comDll.dll /tlb %~dp0comDll.tlb 2 pause
regasm.exe 来自下面的图片所示的位置,具体的使用方法见msdn的文档
以管理员身份运行cmd文件
vba中调用函数的代码,
1 Sub TESGT() 2 Dim comdll As Object 3 Set comdll = CreateObject("comDll.Mycls", "") 4 MsgBox comdll.MyAdd(20, 30) 5 End Sub
在excel中直接当函数使用,具体的见大神的博客
https://www.cnblogs.com/Leo_wl/p/3267201.html#_label1