Automation of running excel macros [Solved/Closed]

Ped - Jun 10, 2009 at 07:53 AM - Latest reply:  Aurorian
- Oct 31, 2012 at 04:41 AM
Hello,

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

If I can convert the macro to Exe file, maybe I can put it to my task manager. Please advice.

Many thanks

Ped
See more 

11 replies

Best answer
Excelguru 261 Posts Saturday April 11, 2009Registration date June 21, 2011 Last seen - Jun 10, 2009 at 10:20 AM
24
Thank you
Hi
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)

Thank you, Excelguru 24

Something to say? Add comment

CCM has helped 1884 users this month

Ur awsum :)
9
Thank you
Hi and thanks a lot.

Now I can schedule opening the excel. What I don't know how to do is:

1. To add macro code to excel open event
2. To close the excel file and save it automatically.


Many thanks again

Ped
Excelguru 261 Posts Saturday April 11, 2009Registration date June 21, 2011 Last seen - Jun 14, 2009 at 07:40 AM
8
Thank you
Hi

1. In the VBE window, in the 'Thisworkbook' page select workbook then add the following three lines
Private Sub Workbook_Open()
' add code here
End Sub
2.workbooks("Workbookname").save

workbooks("Workbookname").close
hi there,

i have a similar problem as posted by another user

i have used windows scheduler to open the workbook every night at 12

i need to run a particular macro from a particular module.

in my auto_open event I already have 3 macros which will run on start up. I need to skip these three macro and run my specific macro every night.

any help will b highly appreciated.

thanks
Excelguru 261 Posts Saturday April 11, 2009Registration date June 21, 2011 Last seen > smd - Sep 3, 2009 at 02:46 AM
Put a condition for the 3 existing macros not to ru if time is 12 AM and add the new macro without this condition
smd_excel 27 Posts Saturday April 18, 2009Registration date November 22, 2012 Last seen > Excelguru 261 Posts Saturday April 11, 2009Registration date June 21, 2011 Last seen - Sep 3, 2009 at 02:52 AM
hi,
thanks for the reply but cud u help me with the code for creating the timing criteria
Excelguru 261 Posts Saturday April 11, 2009Registration date June 21, 2011 Last seen > smd_excel 27 Posts Saturday April 18, 2009Registration date November 22, 2012 Last seen - Sep 3, 2009 at 02:59 AM
if Hour(Time) = "24" then
1
Thank you
Thanks a lot. You saved me so many working hours!
Hi Ped,
Can you share the solution?

Thanks,
Jennifer
rizvisa1 4481 Posts Thursday January 28, 2010Registration dateContributorStatus January 6, 2016 Last seen - Jun 16, 2010 at 04:16 AM