2013-02-18 88 views
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(); 
    } 
+1

在ASP.net,不应它是反向? 'ExportAsFixedFormat(FileFormat,FilePath)' – 2013-02-18 21:41:12

+0

@SiddharthRout即使我切换它们,我仍然有同样的错误。 – BB987 2013-02-18 21:56:52

回答

相关问题