Hello,
I would like to create some code to close an excel file (don't save) and re-open it. The closing and re-opening procedure should occur at a specific time (say midnight) daily. Thanks in advance for your assistance.
Hello,
I would like to create some code to close an excel file (don't save) and re-open it. The closing and re-opening procedure should occur at a specific time (say midnight) daily. Thanks in advance for your assistance.
Take a look at Task Scheduler (control panel, administrative tools)
The code would need some sort of host application to contain it; if you close a workbook that contains code it will immediately halt the execution of that code.
I'd consider placing the code in another spreadsheet, but you'd still be running code nonstop at all other times which isn't super good even with prodigious amounts of DoEvents.
I'd consider using the Windows Task Scheduler to perform a batch file taskkill, alongside another schedule to launch. I have a few workbooks that open themselves on Mondays, run SQL, and auto-email their self refreshed PivotTables and then self close.
Or even invoking the Form_Timer property of an empty Access Form which self runs at an interval you command. I use this type of construct for code I need to run very often (every 80 seconds in my case) but without the volatility of continuous processor burden.
Make Mom proud: Add to my reputation if I helped out!
Make the Moderators happy: Mark the Thread as Solved if your question was answered!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks