Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个代码可以打开 Excel 文件的打印预览(通过 Interops 服务)。我用它来给用户一个预览而不操纵内容。但是当打印预览对话框关闭时,文件本身保持打开状态。对话框被用户关闭后是否可以关闭文件或终止进程(或更好的方法)?
要关闭打开的文件,请在 Workbook 对象上调用 Close() 并在 Excel.Application 对象上调用 Quit()。