Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to suppress overwrite prompts

I have written a C# program to process a large number (1,500) Excel files.
Some of these files are in version 4.0, so I get the following prompt which
stops processing until I manually respond:

"(file name) is a Microsoft Excel 4.0 Worksheet. Do you want to overwrite
with the latest Excel format?"

I always want to overwrite, and I do not want to see this prompt. What can I
do?

Here is the critical code:

Excel.ApplicationClass oEx = new Excel.ApplicationClass();
Excel.Worksheet oWS = (Excel.Worksheet) oEx.Workbooks[1].Worksheets[1];
Excel.Range oRange = (Excel.Range) oWS.Cells;

//...do processing

oEx.AlertBeforeOverwriting = false; //I thought
this property would do the job, but apparently not
oEx.PromptForSummaryInfo = false;
oEx.Workbooks[1].Close(Excel.XlSaveAction.xlSaveChanges, Missing.Value,
Missing.Value);
oEx.Workbooks.Close();


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default how to suppress overwrite prompts

Try changing:
oEx.AlertBeforeOverwriting = false

To:
oEx.DisplayAlerts = False

HTH,
Merjet


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
How do I suppress the "Do you want to overwrite the destination cells" message Rojo Habe Setting up and Configuration of Excel 1 July 30th 09 02:24 PM
Formula Prompts Rob L Excel Discussion (Misc queries) 2 July 13th 08 09:19 AM
Prompts sdmccabe Excel Discussion (Misc queries) 1 April 13th 06 06:03 PM
How can I suppress prompts during macro run? Andorv Excel Discussion (Misc queries) 2 October 19th 05 12:37 PM
Excel prompts me to save a copy or overwrite file. Vinny Excel Worksheet Functions 0 May 20th 05 03:05 PM


All times are GMT +1. The time now is 03: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"