Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
lallyboo
 
Posts: n/a
Default 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   Report Post  
Michael J. Strickland
 
Posts: n/a
Default

"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
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
excel and VB Open Dialog box Anakin Moonwalker Excel Discussion (Misc queries) 2 September 13th 05 08:38 AM
Automatically Close Dialog Boxes chriskane Excel Worksheet Functions 2 August 9th 05 12:14 PM
Create Startup Dialog coal_miner Excel Discussion (Misc queries) 2 June 8th 05 07:25 PM
How can I make Excel display a message (dialog box) upon opening a spreadsheet? Phill Excel Discussion (Misc queries) 8 March 20th 05 06:22 PM
Template in Excel prettytwin1 New Users to Excel 1 March 9th 05 09:22 PM


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