Automation of running excel macros

Solved/Closed
aml - Mar 5, 2010 at 03:05 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 8, 2010 at 04:55 PM
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

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Mar 5, 2010 at 03:37 AM
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
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?
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Apr 8, 2010 at 04:55 PM
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.
0