如何使用特定文件启动 Excel 插件调试器?

use*_*528 3 .net debugging excel vsto

我有 Excel 插件项目,我需要在运行调试时打开特定的 Excel 文件。想法?

sur*_*fen 6

我还没有测试过,但是将以下代码添加到 Startup 事件应该可以:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    #if DEBUG
        this.Application.Workbooks.Open(@"C:\file.xlsx");
    #endif
}
Run Code Online (Sandbox Code Playgroud)