Open sheet once 1st time xl is open

J

jeff

Hey group,

I have my sheet in excel and only want it to open first
time i open excel during the Morning. I have it in xl
start but i want to enable the user to not have to hide
the sheet and only be bothered by it once in the morning.

Is there a way? Thanks in advance

Jeff
 
B

Bernie Deitrick

Jeff,

Sure. But it makes more sense to not put the file in the XLStart folder.

It also requires storing data somewhere - the registry is most convenient
for me. Put this code into the workbook open event of a file in your XLStart
folder - Personal.xls would be a good choice. Change the path and filename
as appropriate.

If GetSetting(appName:="OpenRecord", Section:="Startup", _
Key:="Date") <> Format(Now(), "mm/dd/yyyy") Then
Workbooks.Open Filename:="C:\Excel\OtherFolder\Open Once.xls"
SaveSetting appName:="OpenRecord", Section:="Startup", _
Key:="Date", setting:=Format(Now(), "mm/dd/yyyy")
End If

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Jeff,

On second thought, you could use this code in the open event of the file of
interest, located in the XLStart folder:

If GetSetting(appName:="OpenRecord", Section:="Startup", _
Key:="Date") = Format(Now(), "mm/dd/yyyy") Then
ThisWorkbook.Close False
Else
SaveSetting appName:="OpenRecord", Section:="Startup", _
Key:="Date", setting:=Format(Now(), "mm/dd/yyyy")
End If

HTH,
Bernie
MS Excel MVP
 
Top