2 Ways
1: In the WORKBOOK module (double click on the workbook icon in the VBE), use the Workbook_open event
2: In a GENERAL module, create a sub called auto_open()
Either way will work, however, be aware that neither will work if you open the workbook through code. If this is the case, then you will need to "Call" the auto_open or Workbook_open subs from the code that opens the workbook
HTH
Geoff
Hi Phasid
If Geoff's answer gave you the solution you were looking for then you might like to give him a star.
However I read your posting as when excel launches, ie the application! As I'm low on things to do I thought I'd post this for the hell of it anyway!!
Create & save a file in this location
C:\Program Files\Microsoft Office\Office\XLStart
and add this code to the workbook module as described above.
Private Sub Workbook_Open()
MsgBox "Hello " & Environ$("username"
Application.Workbooks.Add
ThisWorkbook.Close savechanges:=False
End Sub
This is a totally pointless process unless you call another procedure from this code ie open another workbook etc.
God, I need another job!
;-) If a man says something and there are no women there to hear him, is he still wrong?
"...Three Lions On A Shirt..."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.