start a macro everytime excel opens

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hey group,

I have a macro for recording time worked during the
business day. I was wondering if it is possible to open a
sheet with a macro every time i start excel for the first
time in the morning only. I dont want it to update every
time its opened or closed i want to enable the end user on
that regard by clicking the button so they dont forget to
clock in and out

Regards and thanks

Jeff
 
Hi
why not put this file in the XLStart folder?. This way each time you
open Excel this file is opened also
 
Thanks Frank,

But i was trying to have it open only the first time
during the day when i come in usually before 9 and hide
after that so it doesnt pop up all the time. I appreciate
your help though

Jeff
 
How about an addin that has a name containing the date the addin was last
opened?

Something like this:
Sub TimeChecker()
On Error Resume Next
x = ThisWorkbook.Names("LastOpened").Name
If Err.Number <> 0 Then
Names.Add Name:="LastOpened", RefersTo:=Date
On Error GoTo 0
'run sub here
Else
If CDate(Right(ThisWorkbook.Names("LastOpened").RefersTo, 5)) <>
Date Then
ThisWorkbook.Names("LastOpened").RefersTo = Date
On Error GoTo 0
'run sub here
End If
End If
End Sub

Cheers,

Jeff
 

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