Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to display message,when open workbook

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro to display message,when open workbook

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to display message,when open workbook

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro to display message,when open workbook

Here we go. From workbook press Alt+F11 to launch VBE (Visual Basic Editor).
From the left treeview search for the workbook name and click on + to expand
it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to display message,when open workbook

Hi Jacob, i paste the code into this workbook. i saved and closed everything.
i opened the workbook, but the macro didn't displayed any message. i closed
the workbook, set the time to 01.10.2009, and open again. nothing. what am i
doing wrong?
Thanks!

"Jacob Skaria" a scris:

Here we go. From workbook press Alt+F11 to launch VBE (Visual Basic Editor).
From the left treeview search for the workbook name and click on + to expand
it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro to display message,when open workbook

--The code checks whether ;the workbook has been saved in the current month
and if not it will pop-up the message
--Since you have already saved the file the current month it will not
display any message...Instead save;close the file and change the system date
to any date in the next month...and try opening the workbook

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, i paste the code into this workbook. i saved and closed everything.
i opened the workbook, but the macro didn't displayed any message. i closed
the workbook, set the time to 01.10.2009, and open again. nothing. what am i
doing wrong?
Thanks!

"Jacob Skaria" a scris:

Here we go. From workbook press Alt+F11 to launch VBE (Visual Basic Editor).
From the left treeview search for the workbook name and click on + to expand
it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro to display message,when open workbook

Oops.. Please ignore the previous code...Try the below

Private Sub Workbook_Open()
If Format(Me.BuiltinDocumentProperties("Last Save Time"), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, i paste the code into this workbook. i saved and closed everything.
i opened the workbook, but the macro didn't displayed any message. i closed
the workbook, set the time to 01.10.2009, and open again. nothing. what am i
doing wrong?
Thanks!

"Jacob Skaria" a scris:

Here we go. From workbook press Alt+F11 to launch VBE (Visual Basic Editor).
From the left treeview search for the workbook name and click on + to expand
it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to display message,when open workbook

Beautiful.
Thanks!

"Jacob Skaria" a scris:

Oops.. Please ignore the previous code...Try the below

Private Sub Workbook_Open()
If Format(Me.BuiltinDocumentProperties("Last Save Time"), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, i paste the code into this workbook. i saved and closed everything.
i opened the workbook, but the macro didn't displayed any message. i closed
the workbook, set the time to 01.10.2009, and open again. nothing. what am i
doing wrong?
Thanks!

"Jacob Skaria" a scris:

Here we go. From workbook press Alt+F11 to launch VBE (Visual Basic Editor).
From the left treeview search for the workbook name and click on + to expand
it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Can you help me a little bit with how to use the Workbook Open event?
Thanks!

"Jacob Skaria" a scris:

Use the Workbook Open event.....and try the below code

Private Sub Workbook_Open()
If Format(FileDateTime(Me.FullName), "mmyy") < _
Format(Date, "mmyy") Then MsgBox "first day of the month,please save"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, i need a macro to display a message, first time i open workbook in new
month. If today is 01.11.2009, and i open my workbook, then, the macro to
display message "first day of the month,please save".
Sometime the first day of the month can be sunday, and i will open my
workbook, on the second day of the month, or another day. Can this macro be
made to display the message first time i open workbook in the new month?
Can this be done?
Thanks!

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
Display a message when a macro is executing alexrs2k Excel Discussion (Misc queries) 2 September 11th 09 05:20 PM
Macro in 2nd Open workbook Steve Excel Discussion (Misc queries) 1 January 28th 08 05:35 PM
Display message upon file open even with macro security set to high [email protected] Excel Discussion (Misc queries) 1 November 11th 06 02:43 PM
macro to open outgoing message with info Scott Marcus Excel Discussion (Misc queries) 0 June 22nd 06 04:07 PM
can i have a pop up reminder message when i open a workbook? j jones New Users to Excel 2 November 16th 05 08:07 PM


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