ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Running Excel macro as a service (https://www.excelbanter.com/excel-discussion-misc-queries/204510-running-excel-macro-service.html)

Yan

Running Excel macro as a service
 
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


Thomas [PBD]

Running Excel macro as a service
 
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 StartHelp and
SupportSchedule a new task. Ensure that the workbook Starts In Microsoft
Excel under the Advanced section.

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


"Yan" wrote:

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 H

Running Excel macro as a service
 
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


"Yan" wrote:

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


FSt1

Running Excel macro as a service
 
hi
thomas has a good idea but just to give another option, you might try
looking at the ontime event in excel.
see this site for more details.
http://www.cpearson.com/excel/OnTime.aspx

Regards
FSt1

"Yan" wrote:

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 H

Running Excel macro as a service
 
Thomas,

You have the issue of enabling macros with this method.

Mike

"Thomas [PBD]" wrote:

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 StartHelp and
SupportSchedule a new task. Ensure that the workbook Starts In Microsoft
Excel under the Advanced section.

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


"Yan" wrote:

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


Thomas [PBD]

Running Excel macro as a service
 
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.

ToolsMacroSecurityLow 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" wrote:

Thomas,

You have the issue of enabling macros with this method.

Mike

"Thomas [PBD]" wrote:

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 StartHelp and
SupportSchedule a new task. Ensure that the workbook Starts In Microsoft
Excel under the Advanced section.

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


"Yan" wrote:

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



All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com