ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open sheet once 1st time xl is open (https://www.excelbanter.com/excel-programming/304281-open-sheet-once-1st-time-xl-open.html)

jeff

Open sheet once 1st time xl is open
 
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

Bernie Deitrick

Open sheet once 1st time xl is open
 
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

"jeff" wrote in message
...
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




Bernie Deitrick

Open sheet once 1st time xl is open
 
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

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
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

"jeff" wrote in message
...
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







All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com