Click here to Skip to main content
15,902,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
-i convert .xls to .pdf file i done this successfully but my problem is that

suppose i have a one excel file with name xyz.xls and in that excel file 3(three) worksheet A,B and C and i want to create pdf of only B worksheet how i pass parameter "paramSourceBookPath"

excelWorkBook = excelApplication.Workbooks.Open(paramSourceBookPath, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing);




currenty i pass @"C:\xyz.xls" but it crtae all tree A, B,C as a combine in one Pdf But i dont want A and C i need Only B worksheet as a pdf.


-i follow below link for do this.

http://msdn.microsoft.com/en-us/library/bb407651%28v=office.12%29.aspx[^]
Posted
Updated 3-Jun-13 23:34pm
v2

1 solution

There you'll find your solution: Convert Excel(.xls) file to .pdf File[^].
Read my comments carefully ;) and try!
 
Share this answer
 
Comments
bhavesh002 4-Jun-13 7:15am    
// Open the source workbook. excelWorkBook = excelApplication.Workbooks.Open(paramSourceBookPath, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing); // get all sheets in workbook Microsoft.Office.Interop.Excel.Sheets excelSheets = excelWorkBook.Worksheets; // get some sheet string currentSheet = "Data"; Microsoft.Office.Interop.Excel.Worksheet excelWorksheet =(Microsoft.Office.Interop.Excel.Worksheet)excelSheets.get_Item(currentSheet);


yes i done using above code

thanx.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900