On file in XLSTART folder.

shajueasow

Well-known Member
Joined
Oct 7, 2004
Messages
1,926
Hi,
I have an excel file in XLSTART folder and it runs whenever Excel is launched. But can something be done so that it runs only once in a day. I use to launch excel 4-5 times a day and leaving the system running the whole day also is not a viable option.
TIA
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
So maybe instead of XLStart you put the file into Windows startup

Then as you go thru the day and start a new excel session that file doesn't automatically open

HTH
 
Upvote 0
Following Texasalynn's suggestion even further, put in as a scheduled task so you could have it run at a specific time(s) of the day, not just on startup.
 
Upvote 0
Hi,

you could write the date to a cell on open
Code:
Option Explicit

Private Sub Workbook_Open()
Dim checkCell As Range
Set checkCell = Sheets(1).Cells(1, 1)

If Date - checkCell < 1 Then Exit Sub
checkCell = Date
'other code
End Sub
when opening the workbook again it will check for the "day-difference"
if not at least "1" then the code exits and does nothing more

kind regards,
Erik
 
Upvote 0
Thank You texasalynn and jonmo1 for your suggestions.
As I have stated I cannot keep the system running all the day....so even if the file is kept in Windows Startup folder, it will run each time windows is booted into.
And regarding using the scheduled task... it will run only at the time specified for it, and if the system is not running at that time...that also won't bring the desired result.
Thank you Erik for the code, that should settle the problem.
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,957
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top