Running Excel macro as a service

  • Thread starter Thread starter Yan
  • Start date Start date
Y

Yan

Hello,

I need to run an Excel (2003) macro as a service. Every day at 2 pm to copy
data from one worksheet to another.

I alredy have written a macro but how do I set it to run everyday at 2 PM ?

Thanks

Yan
 
Hi,

I assume the workbook is open.

Application.OnTime TimeValue("14:00:00"), "RunOnTime"
'Do things

Put this as the first line of your macro. Change the name "RunOnTime" to the
name of your macro. Run it and will run again every day at 2PM

Mike
 
Thomas,

You have the issue of enabling macros with this method.

Mike

Thomas said:
Yan,

You could set this macro to run in the Workbook_Open or Auto_Open command of
a workbook, set the workbook on a schedule to open. Ensure that you have a
command in your macro to close the book when it's done. You can save that
Workbook as "Scheduled Task" somewhere.

If you dont know how to schedule tasks in Windows, refer to Start>Help and
Support>Schedule a new task. Ensure that the workbook Starts In Microsoft
Excel under the Advanced section.

--
--Thomas [PBD]
Working hard to make working easy.


Yan said:
Hello,

I need to run an Excel (2003) macro as a service. Every day at 2 pm to copy
data from one worksheet to another.

I alredy have written a macro but how do I set it to run everyday at 2 PM ?

Thanks

Yan
 
Mike,

I hate that little annoying pop-up. I would advise that someone set their
Macro Security to low if they were going to use the scheduler. I have mine
set to low, so things run without me having to approve it. Some individuals
may like the validation that comes with knowing that what they have set in a
macro is accomplishing its task as scheduled... not me personally.

Tools>Macro>Security>Low for any users that wish to do this. Remember that
this will allow macros to run without your permission, so if you worry about
security to your computer and network, I advise against it.

--
--Thomas [PBD]
Working hard to make working easy.


Mike H said:
Thomas,

You have the issue of enabling macros with this method.

Mike

Thomas said:
Yan,

You could set this macro to run in the Workbook_Open or Auto_Open command of
a workbook, set the workbook on a schedule to open. Ensure that you have a
command in your macro to close the book when it's done. You can save that
Workbook as "Scheduled Task" somewhere.

If you dont know how to schedule tasks in Windows, refer to Start>Help and
Support>Schedule a new task. Ensure that the workbook Starts In Microsoft
Excel under the Advanced section.

--
--Thomas [PBD]
Working hard to make working easy.


Yan said:
Hello,

I need to run an Excel (2003) macro as a service. Every day at 2 pm to copy
data from one worksheet to another.

I alredy have written a macro but how do I set it to run everyday at 2 PM ?

Thanks

Yan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top