AutoOpen Code

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I used the following code so the user is reminded to
update the averages each time they open the workbook -
Although it's not working - What is wrong with my code?

Sub Auto_Open()
Dim strMsg As String
Dim strTitle As String
Dim intUpdate As Integer
Dim intStatusState As Integer

strMsg = "UPDATE AVERAGES"
strTitle = "Friendly Reminder"

End Sub
 
Karen,

Your code doesn't do anything beyond set the values of some
variables. Did you forget to put in the MsgBox statement?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi Karen,

You need an additional line like:

MsgBox prompt:=strMsg, Title:=strTitle
 
Thank you for your help

I don't know what I'm doing wrong
Can you show me exactly how my code should read if I want
a dialog box to open when the workbook opens

Message - Update Averages
Title - Friendly Reminder
 
Hi Karen,

Right-click the Excel icon to the left of the File Menu | View Code |
Paste the following code:

Sub workbook_open()
Dim strMsg As String
Dim strTitle As String

strMsg = "UPDATE AVERAGES"
strTitle = "Friendly Reminder"
MsgBox prompt:=strMsg, Title:=strTitle
End Sub
 
Thank you so much for your help - It works great!
Although, when I open the workbook, I'm getting the
infamous message: This workbook contains links to other
data sources. If you don't update the links, Excel will
attempt to retrieve the latest data. If you don't update
the links, Excel will use the previous information. How
can I get rid of this message so it doesn't keep poppin
up?

Thank you and Happy Thanksgiving
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top