1
我使用C#通过VSTO构建Excel AddIn,我想要做的一件事就是自动将我写入(一个.bas文件)的VBA模块导入到Excel中,并在运行时运行它用户从Excel的Com AddIns中导入我的Excel AddIn。c#VSTO从硬盘驱动器运行VBA模块
我想这样的:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.Run(@"C:\myModule.bas");
}
但是有错误:Cannot run the macro 'C:\myModule.bas'. The macro may not be available in this workbook or all macros may be disabled.
在此先感谢谁读我的问题的人!
谢谢!我现在正在发短信。将进一步讨论。 –
你需要先导入它,因为我已经显示在上面,然后你可以运行它 –
我现在工作得很好!谢谢! –