Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help - Excel Automation: Turning off all dialog boxes (prompts).

Hi,

I have written an excel wrapper class in C#. Excel automation
components are used to read the excel file in my wrapper class. Now the
problem is, I get a dialog box with the following message in one of the
files that is being processed (when it is opened in Excel application
by double clicking on the file in windows explorer).

"Name conflicts with existing module, project, or object library"

ok. It tells me some VBA reference is wrong in the Excel file. But I
couldn't bypass this dialog programmatically. This wrapper class is
used in a non-interactive environment. Here is the sample code..

Excel.Application excelApplication = null;
Excel.Workbooks workBooks = null;
Excel.Workbook workBook = null;
string fileName = @"c:\temp\myexcelfile.xls";
object missingValue = Missing.Value;

try
{
excelApplication = new Excel.ApplicationClass();

// turn-off all interactive features
excelApplication.Visible = false;
excelApplication.Interactive = false;
excelApplication.DisplayAlerts = false;
excelApplication.DisplayInfoWindow = false;
excelApplication.ScreenUpdating = false;
excelApplication.AlertBeforeOverwriting = false;
excelApplication.AskToUpdateLinks = false;

// Open workbook
workBooks = excelApplication.Workbooks;
workBook = workBooks.Open(fileName, false, true, missingValue,
missingValue, missingValue,
missingValue, missingValue, missingValue, false, false,
missingValue, false, missingValue, true);

...........
...........
}
catch(Exception e)
{
System.Console.WriteLine(e.Message);
}
finally
{

.......
}

The application hangs at "Open" method and waiting for the dialog to be
closed. Is there anyway to turn off all the dialog boxes? As far as I
can see, I handled all the interactive properties in my code. But
still, the open method hangs.

Any help would be appriciated.

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel FileSaveAs dialog freezes when used via automation from Access No Name Excel Programming 0 May 15th 05 08:49 AM
Turn off printing status dialog with Excel automation gm Excel Programming 0 March 21st 05 04:31 PM
disabling Excel pop-up dialog boxes John Excel Programming 2 February 23rd 05 07:09 PM
Suppressing or turning off the Printing dialog Jeff Lefebvre Excel Programming 4 February 8th 05 11:17 PM
Dialog boxes in Excel Robert Couchman Excel Programming 1 January 30th 04 12:17 PM


All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"