Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Message box at file open

For a particular Excel file, I want a message box to open as soon as the
file is opened.

Do I need to use VBA for that?

If yes, I'm new to VBA. Any quick pointers?

Thanks all.


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Message box at file open

Hall,

Do I need to use VBA for that?

Yes, you do.

From the workbook, press Alt + F11
Double click on "THisWorkbook" in the "Projects" window.
In the panel on the right, copy and paste the following:

Private Sub Workbook_Open()
MsgBox "My message"
End Sub

John

"Hall" wrote in message
...
For a particular Excel file, I want a message box to open as soon as the
file is opened.

Do I need to use VBA for that?

If yes, I'm new to VBA. Any quick pointers?

Thanks all.




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Message box at file open

Hall wrote:

For a particular Excel file, I want a message box to open as soon as the
file is opened.

Do I need to use VBA for that?

If yes, I'm new to VBA. Any quick pointers?


Hi, you need to put this code in the Workbook_Open event.

Private Sub Workbook_Open()
Msgbox "This book has just been opened"
End Sub

How do you do this?
Start the Visual Basic Editor (Alt+F11) and go to the Projet Explorer to
the left (where it says project and there is a tree with Microsoft Excel
Objects and Modules). If you don't see it, go to View/Project Explorer.
Now double-click on ThisWorkbook and on the code window put the code I
wrote above. That's all!

Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.

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
After File Open View Preview get error message big-bob Excel Discussion (Misc queries) 4 November 3rd 06 08:24 PM
I am receiving a "unable to read file" message. How do I open? Alanb Excel Discussion (Misc queries) 3 July 5th 05 10:18 PM
open file file then error message Piroon Saetang Excel Discussion (Misc queries) 1 February 4th 05 12:05 AM
When i open my Excel file this message prompt: Gilles Chartier Excel Programming 2 December 3rd 03 12:51 PM
Using Message Box to Open/Import Text File hjones Excel Programming 1 November 18th 03 06:20 PM


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