我正在将一个 excel 文件转换为一个 pdf 文件,但是当我传入用于导出的字符串时,我得到了这个错误(红色下划线 convertFilePath)Argument type string is not assignable to parameter type Microsoft.Office.Interop.Excel.XIFixedFormatType
var convertFileId = Guid.NewGuid();
var convertFilePath = @"c:\temp\" + convertFileId + ".pdf";
public Microsoft.Office.Interop.Excel.Workbook excelWorkbook { get; set; }
void ExcelToPdf(string convertFilePath)
{
Microsoft.Office.Interop.Excel.Application appWord = new Microsoft.Office.Interop.Excel.Application();
excelWorkbook = appWord.Workbooks.Open(DocumentUNCPath.Text);
excelWorkbook.ExportAsFixedFormat(convertFilePath, WdExportFormat.wdExportFormatPDF);
excelWorkbook.Close();
appWord.Quit();
}