c# - Convert a list of excel sheets (sheet name list provided) into a single PDF file -


i need add selected set of sheets pdf using microsoft.office.interop.excel library in c#. have been searching throught net figure out how this. haven't been able find helpful. can me this. found following statement convert given sheet pdf. looks like, cannot append list of excel sheets 1 pdf when provide sheet names.

xlws.exportasfixedformat(excel.xlfixedformattype.xltypepdf, endpath); 

help please.

you can use worksheet.exportasfixedformat method.

example:

string exportfilepath = @"c:\desktop\test.pdf"; activeworksheet.exportasfixedformat(xlfixedformattype.xltypepdf, exportfilepath); 

or can use workbook.exportasfixedformat method

string exportfilepath = @"c:\desktop\test.pdf"; activeworksheet.exportasfixedformat(xlfixedformattype.xltypepdf, exportfilepath); 

references:

https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.exportasfixedformat.aspx

https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.exportasfixedformat.aspx


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -