#1
|
|||
|
|||
Excel to PDF
HI
i have created a program which takes excel file path and directly exports to the pdf format using office in c#. my problem is while exports it shows the notification of preogressbar. i dont want this progressbar. how to disable this. i used Application.disablealert=true. but no use help me below is my code ----------------- ApplicationClass excelApplication = newApplicationClass(); Workbook excelWorkBook = null; excelApplication.DisplayAlerts = false; string paramSourceBookPath = @"E:\indata\BAC\FileSplitter\Ready\EDOC0E159851057 44D5BA91BECCCFB0D111F\Kelly_FaxImage_JobID_updated .xlsx"; object paramMissing = Type.Missing; string paramExportFilePath = @"C:\Test.pdf"; XlFixedFormatType paramExportFormat = XlFixedFormatType.xlTypePDF; XlFixedFormatQuality paramExportQuality = XlFixedFormatQuality.xlQualityStandard; bool paramOpenAfterPublish = false; bool paramIncludeDocProps = true; bool paramIgnorePrintAreas = true; object paramFromPage = Type.Missing; object paramToPage = Type.Missing; try { // Open the source workbook. excelWorkBook = excelApplication.Workbooks.Open(paramSourceBookPat h, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing, paramMissing); // Save it in the target format. if (excelWorkBook != null) excelWorkBook.ExportAsFixedFormat(paramExportForma t, paramExportFilePath, paramExportQuality, paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage, paramToPage, paramOpenAfterPublish, paramMissing); } catch (Exception ex) { // Respond to the error. } finally { // Close the workbook object. if (excelWorkBook != null) { excelWorkBook.Close(false, paramMissing, paramMissing); excelWorkBook = null; } // Quit Excel and release the ApplicationClass object. if (excelApplication != null) { excelApplication.Quit(); excelApplication = null; } GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); GC.WaitForPendingFinalizers(); |
#2
|
||||
|
||||
I assume you mean Excel's statusbar. For that, 'excelApplication.DisplayAlerts = false;' won't work; you need 'excelApplication.StatusBar = false;'
PS: When posting code, please use the code tags (they're on the advanced screen).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel 2007 custom ribbon not showing in Excel 2010 | Paulzak | Excel | 2 | 02-17-2012 06:35 PM |
saving data in excel 2010 from excel 2003 | johnkcalg | Excel | 1 | 02-06-2012 07:33 PM |
VBA code from Excel 2007 in Excel 2010 | csam63 | Excel Programming | 1 | 10-07-2011 10:46 AM |
Excel Hyperlinks crash Excel programme | martinlest | Excel | 8 | 01-26-2011 04:23 AM |
Opening multiple Excel files within the same Excel window. | lost9471 | Excel | 2 | 05-01-2010 01:57 PM |