That was the original code that I was given, but the message box only displays when the Excel file has opened fully.
Andrew,
Here's an idea. Create a TextBox (not a TextBox control, but a TextBox drawing object--actually a Shape object) on the sheet that first displays so that it appears immediately. The text in the textbox would say something like:
Please wait while links are updated...
Then add code to the Worksheet's Open event that makes the Textbox disappear using the textbox's Visible property, and to the worksheet's Close event that makes it reappear so that it will be visible next time the workbook is first opened:
Shapes("TextBox 1").Visible = False
In place of "TextBox 1" string, insert the actual name of your textbox. This name displays in the Name Box on the left side of the formula bar when you select the TextBox. Also, in the Close event activate the worksheet it is on so that it will be the sheet that first appears when the workbook opens:
Worksheets("My Data").Activate
Happy computing.
Damon
Nope. Only displays once the file has opened
I am looking for a comment to be displayed as soon as you double click on the Excel file to open it,
Re: Nope. Only displays once the file has opened
Andrew, I really think the only way you are going to achieve what you want is if you create a separate Workbook that is used to:
1) Display a "Please Wait" Message
2) Open your Workbook
3) Display a "Thank You for Waiting" Message
4) Close itself
You could do this a few different ways, add a command button and let the user click it, or put the following code into the Workbook_Open event and it will execute automatically.
Code Example
Sub cmdOpen_Click()
Dim sThisWkBook As String
sThisWkBook = ActiveWorkbook.Name
MsgBox "Please wait while Links are updated"
Application.Cursor = xlWait
Workbooks.Open ("C:\Full Path and File Name to your Workbook.xls")
Application.Cursor = xlDefault
MsgBox "Thank You for Your Patience"
Workbooks(sThisWkBook).Close False
End Sub
Hope this help.
Jerid