我有 Excel 加载项项目,我需要在运行调试时让它打开特定的 Excel 文件。想法?
最佳答案
我还没有测试过,但将以下代码添加到 Startup 事件应该可以:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
#if DEBUG
this.Application.Workbooks.Open(@"C:\file.xlsx");
#endif
}
关于.net - 如何使用特定文件启动 Excel 加载项调试器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6080493/