none
Save Excel as PDF RRS feed

  • 问题

  • I want to export excel and save as PDF ..

    When I run this code:

    workbook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, filePath+".pdf" ,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);
    

    in server,it throw a exception:

    The remote procedure call failed. (Exception from HRESULT: 0x800706BE)

    I debug in local is ok!!!!

    Help!!!!!!


    Ellis_Wong


    2013年8月14日 6:45

答案

  • Sorry for the delay.

    If it is office 2010, the add-in is installed by default.

    Another possibility is that you didn't install any printer on your server. Please check if Microsoft XPS Document Writer is installed. ExportAsFixedFormat method will call the printer when you want to convert your excel file to pdf file. Set this printer as default.


    Caillen
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年8月21日 3:26
    版主

全部回复