我想在打印预览中打开Excel文件而不显示它,并将其另存为PDF或图像文件。
有可能吗?我怎么能意识到它?
答案 0 :(得分:0)
可以使用Worksheet对象的ExportAsFixedFormat
方法完成:
using Excel = Microsoft.Office.Interop.Excel;
Excel.Worksheet ws; // you need to assign this somehow
ws.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF,
@"c:\YourFile.pdf", Excel.XlFixedFormatQuality.xlQualityStandard);