Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2012, 07:13 AM
smk2001in smk2001in is offline Excel to PDF Windows XP Excel to PDF Office 2007
Novice
Excel to PDF
 
Join Date: Mar 2012
Posts: 1
smk2001in is on a distinguished road
Default 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();
Reply With Quote
  #2  
Old 03-22-2012, 11:07 PM
macropod's Avatar
macropod macropod is offline Excel to PDF Windows 7 64bit Excel to PDF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

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
Excel to PDF saving data in excel 2010 from excel 2003 johnkcalg Excel 1 02-06-2012 07:33 PM
Excel to PDF VBA code from Excel 2007 in Excel 2010 csam63 Excel Programming 1 10-07-2011 10:46 AM
Excel to PDF Excel Hyperlinks crash Excel programme martinlest Excel 8 01-26-2011 04:23 AM
Excel to PDF Opening multiple Excel files within the same Excel window. lost9471 Excel 2 05-01-2010 01:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft