Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    65

    Unanswered: 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!

  2. #2
    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

  3. #3
    Join Date
    Jan 2004
    Posts
    65
    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 16:21.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •