2013-02-18 87 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

回答

相關問題