Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Automatic message

Is there a way of setting up a message, that will display in a small pop-up
window, every time someone opens a specific Excel workbook? the user would
have to click OK to actually open the document.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Automatic message

Yes there is a way but why not just password the workbook?

User would have to enter the password to open.

But to give you what you ask for.

Private Sub Workbook_Open()
X = MsgBox("Click OK to access this workbook", vbOKCancel)
If X = vbCancel Then GoTo endit
Exit Sub
endit:
ThisWorkbook.Close , Saved = True
End Sub

Copy/paste into Thisworkbook Module


Gord Dibben MS Excel MVP

On Wed, 14 Apr 2010 15:57:21 -0700, richzip
wrote:

Is there a way of setting up a message, that will display in a small pop-up
window, every time someone opens a specific Excel workbook? the user would
have to click OK to actually open the document.

Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Automatic message

If your users do not enable macros, you may find yourself having to do some
complex (and generally unsatisfying) workarounds. However, if your users
always enable macros when opening your workbook, you can use the following
solution.

Otherwise, my best suggestion would be to make your data sheet veryhidden,
so if the user doesn't enable macros they can't reach the data (at least not
the casual user), so they will re-open the file with macros enabled, and then
see your message. That will involve incorporating code to show/hide sheets,
and use the workbook_close event to re-hide everything when closing.

To get the message showing in an macro-enabled workbook

In the workbook_open event, add the following line of code:

msgbox "this is the message"

To find the workbook_open event:
1. open the VBE by pressing Alt-F11
2. on the left side, look for a panel called "Project - VBA Project". If you
don't see it, press Ctrl-R
3. Find your workbook, and expand the subfolders until you see a line called
"ThisWorkbook". Double click it to bring up the workbook code window.
4. In the workbook code window, at the top, change the left drop-down box
from (General) to Workbook
5. It should default to Workbook_open and insert a line of code that says
"Private Sub Workbook_Open()" and another line below that says "End Sub". If
so, just paste that one line of code (above) into your workbook. If the line
that was inserted 6. is Workbook_[something else] then go to the top right
drop-down box and select "Open", then go back to step 5, find the correct
code block, and insert the line of code.

HTH,
Keith

"richzip" wrote:

Is there a way of setting up a message, that will display in a small pop-up
window, every time someone opens a specific Excel workbook? the user would
have to click OK to actually open the document.

Thank you.

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
Automatic Pop-up Message patsy Excel Discussion (Misc queries) 4 January 12th 09 11:08 PM
Automatic links message when opening a workbook pgarcia Excel Discussion (Misc queries) 2 March 8th 07 10:53 PM
Automatic message kanye Excel Discussion (Misc queries) 1 April 27th 05 04:02 PM
Disable Automatic Link Message Kavi[_3_] Excel Programming 2 October 13th 03 04:31 PM
Automatic response to message box? Benjamin[_3_] Excel Programming 1 September 15th 03 03:52 PM


All times are GMT +1. The time now is 04:27 PM.

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"