open a "reminder to update" box when workbook is opened

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on a workbook that will require a download update each day. I have heard there is a way to have a message box open first when you open a workbook. I would like to have a message "Do you need to update?" come up before the workbook opens. I have seen vba and the editor within excel but have never really used it or written code. My ability is limited to very simple editing of code. Would someone help me with specific instructions if this is possible? I would really appreciate it.
 
Terry, here is one way, will show the message when the workbook opens, if
you enable macros

Private Sub Workbook_Open()
MsgBox "Do you need to update?"
End Sub

To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in the left hand window double click on thisworkbook, under
your workbook name, and paste the code in the window that opens on the right
hand side, press Alt and Q to close this window and go back to your
workbook, now this will run every time you open the workbook. If you are
using excel 2000 or newer you may have to change the macro security
settings to get the macro to run.

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
terrythomas said:
I am working on a workbook that will require a download update each day.
I have heard there is a way to have a message box open first when you open a
workbook. I would like to have a message "Do you need to update?" come up
before the workbook opens. I have seen vba and the editor within excel but
have never really used it or written code. My ability is limited to very
simple editing of code. Would someone help me with specific instructions if
this is possible? I would really appreciate it.
 
Paul, You are really awesome! It worked like a charm. They will be very impressed at work. I told them about this site and I don't think they really believed me that people are such a help to others. I really thank you!!
 
Hi Terry

you could really impress them and build the UPDATE operation into the macro
when they press the Yes button.

If you modify Paul's code as follows:
******
Private Sub Workbook_Open()

dim i as integer

i = MsgBox("Do you need to update?",vbyesno,"Update?")

if i = vbno then
msgbox "Okay - on with your work!"
Else
'record the update operation as a separate macro & cut and paste the
black bits it in here and see if it works
msgbox "Update finished ... time to get back to work!"
End if

End Sub

********

Let us know how you get on.

Cheers
JulieD


terrythomas said:
Paul, You are really awesome! It worked like a charm. They will be very
impressed at work. I told them about this site and I don't think they
really believed me that people are such a help to others. I really thank
you!!
 

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