If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > How to bypass confirmation dialogs during VB code execution

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-04, 14:54
MDesigner MDesigner is offline
Registered User
 
Join Date: Jan 2004
Posts: 65
How to bypass confirmation dialogs during VB code execution

I'm using VB within DTS to dump data to an Excel sheet. Whenever I do something like Worksheets(1).Delete(), a confirmation dialog comes up. How can I just have the code delete it without asking? This DTS package will be executed via ASP on the web, and I don't want these confirmation dialogs to cause any problems.

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 15:05
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
At the beginning of the section/code include this line:

Application.DisplayAlerts = False

Then at the end use this line:

Application.DisplayAlerts = True
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 02-09-04, 15:17
MDesigner MDesigner is offline
Registered User
 
Join Date: Jan 2004
Posts: 65
Quote:
Originally posted by shades
At the beginning of the section/code include this line:

Application.DisplayAlerts = False

Then at the end use this line:

Application.DisplayAlerts = True
But if a dialog pops up that wants a yes/no answer... how will the code respond to this? Is yes the default?

Thanks though! This did do the trick. I did xlApp.DisplayAlerts = False (xlApp is the Excel.Application)

Last edited by MDesigner; 02-09-04 at 15:21.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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