Automation of running excel macros

[Solved/Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I have a macro in excel which needs to be run once a day and i dont even want to open the excel sheet. How can i make this process automatic?

i saw some information,but i'm not understand


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


what is "excel open event" ?


please guide me...

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Ok two things.

1. excel cannot by its own fire up and start execution of code. For that you need some thing else that is running to start excel. What you have read is suggesting to use ""Scheduled Tasks" to do that.


2. Once the excel open up, macro can be embedded in excel to immediately fire up. This is triggered by an event called "open". Basically it is sub routine named "Auto_Open"

Sub Auto_Open()
... <code goes here>
End sub


Hope it clarifies things for you
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month

What if the file is already open (never closes because receiving data in a live environment) and still need to run a macro to make a back-up copy at 7:00 A.M every day?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Well in that case you can have a timed tasked to check for time and its 7:00 am then execute the take. This can be done by some thing like this

Application.OnTime TimeValue("07:00:00"), "my_Procedure"

Which basically says at 7 execute this procedure.