A few words of thanks would be greatly appreciated.

Excel - Running Macro Automatically


You have a macro in excel that needs to be run twice a day and you don't even want to open the Excel sheet. How can you make this process automatic?


Add the macro code to Excel open event. You can create an excel file and make it run twice a day
by creating a new task and by adding its path to "Scheduled Tasks" within double quotes under:
Start>Programs>Accessories>System Tools

  • <souligne>In the VB window > 'Thisworkbook' page select workbook then add the following coDes:
Private Sub Workbook_Open()  
' add code here
End Sub


As for the time:

If Hour(Time) = "24" then 

Thanks to Excelguru for this tip on the forum.


A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Excel - Running Macro Automatically », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).