Csharp/C#教程:从C#调用VBA函数分享


从C#调用VBA函数

是否可以调用VBA函数(在Access中),该函数从外部世界获取两个字符串参数(例如来自c#但其他人也会这样做)?

这是从C#调用访问数据库函数的一个示例,我过去使用它来创建类似的function。

private void btnRunVBAFunction_Click(object sender, System.EventArgs e) { Access.Application acApp = new Access.ApplicationClass();//create msaccess application acApp.OpenCurrentDatabase(@"C:tempdb1.mdb",false ,null);//open mdb file object oMissing = System.Reflection.Missing.Value; //Run the Test macro in the module acApp.Run("Test",ref oMissing,ref oMissing,ref oMissing,ref oMissing, ref oMissing,ref oMissing,ref oMissing,ref oMissing, ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing ,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing ,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing ,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing ,ref oMissing,ref oMissing); acApp.Quit();//exit application } 

这是我过去使用过的网站。

https://bytes.com/topic/c-sharp/answers/255310-run-microsoft-access-module-vs-net-c

有一篇关于从C#自动化Access的知识库文章应该可以帮助您入门。

上述就是C#学习教程:从C#调用VBA函数分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/1027620.html

(0)
上一篇 2022年1月10日
下一篇 2022年1月10日

精彩推荐