1

I have multiple sheets in workbook and selected few using

 String[] sheetsToBeSelected = { "month", "day" };

 ((Sheets)ws.get_Item(sheetsToBeSelected)).Select();   

 Worksheet sheet = excelApp.ActiveSheet; 

 sheet.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, pdfFileName, XlFixedFormatQuality.xlQualityStandard, false, false, Missing.Value, Missing.Value, !isPrintingSilent, Missing.Value);   

Now I want to print only selectedsheets into PDF not the complete workbook using ExportAsFixedFormat. How I can do that?

I have found the solution and workaround is updated in the code above. Hope it will help others.

Deepti
  • 21
  • 5
  • VBA, but you should be able to adapt to C#... http://stackoverflow.com/questions/14404650/excel-save-multiple-sheets-to-pdf/14407986#14407986 – Tim Williams Sep 12 '14 at 06:20
  • I used the code below and it worked Worksheet sheet = excelApp.ActiveSheet; sheet.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, pdfFileName, XlFixedFormatQuality.xlQualityStandard, false, false, Missing.Value, Missing.Value, !isPrintingSilent, Missing.Value); – Deepti Sep 12 '14 at 07:15
  • Hi me how, That thread is about exporting different sheets to different pdf and my question is about exporting to same pdf. – Deepti Sep 12 '14 at 12:12
  • It is a bit misleading to have a working solution in your question. Better to post your own answer I think. – Vojtěch Dohnal Sep 12 '14 at 12:30

0 Answers0