0
我转换Excel文件为PDF文件,但是当我传递的字符串中导出我得到这个错误(红色下划线convertFilePath)Argument type string is not assignable to parameter type Microsoft.Office.Interop.Excel.XIFixedFormatType
字符串不能分配给参数类型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();
}
在ASP.net,不应它是反向? 'ExportAsFixedFormat(FileFormat,FilePath)' – 2013-02-18 21:41:12
@SiddharthRout即使我切换它们,我仍然有同样的错误。 – BB987 2013-02-18 21:56:52