Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
"lallyboo" wrote in message
... 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 703-560-7380 --------------------------------------------------------------- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel and VB Open Dialog box | Excel Discussion (Misc queries) | |||
Automatically Close Dialog Boxes | Excel Worksheet Functions | |||
Create Startup Dialog | Excel Discussion (Misc queries) | |||
How can I make Excel display a message (dialog box) upon opening a spreadsheet? | Excel Discussion (Misc queries) | |||
Template in Excel | New Users to Excel |