Automation of running excel macros

Solved/Closed
aml - 5 Mar 2010 à 03:05
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 8 Apr 2010 à 16:55
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...
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
5 Mar 2010 à 03:37
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
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?
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
8 Apr 2010 à 16:55
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.