+ Reply to Thread
Results 1 to 2 of 2

how do i create a dialog box to appear on opening an excel wkbook

  1. #1
    lallyboo
    Guest

    how do i create a dialog box to appear on opening an excel wkbook

    I want to create a dialog box that appears on opening an excel workbook along
    the lines of "this workbook contains terminated contracts, do you wish to
    proceed?". I have seen dialog boxes on workbooks before but do not know how
    to create them myself.



  2. #2
    Michael J. Strickland
    Guest

    Re: how do i create a dialog box to appear on opening an excel wkbook

    "lallyboo" <[email protected]> wrote in message
    news:[email protected]...
    >I want to create a dialog box that appears on opening an excel workbook
    >along
    > the lines of "this workbook contains terminated contracts, do you wish to
    > proceed?". I have seen dialog boxes on workbooks before but do not know
    > how
    > to create them myself.
    >
    >


    Open the workbook and go to the VBA editor (Alt-F11). Click on the "Project
    Explorer" icon and select "ThisWorkbook".

    At the top of the right hand pane, left side, select "Workbook" from the
    drop down list.
    At the top of the right hand pane, right side, Select "Open" from the drop
    down list.

    Put this code in the Workbook_Open event (right hand pane) of the workbook:

    Private Sub Workbook_Open()

    Dim strResponse As String

    strResponse = InputBox("This workbook contains terminated contracts, do
    you wish to proceed?", "Input", "N")
    If UCase(strResponse) <> "Y" Then
    Application.Quit
    End If

    End Sub

    --
    ---------------------------------------------------------------
    Michael J. Strickland
    Quality Services [email protected]
    703-560-7380
    ---------------------------------------------------------------



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1