Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Scheduling a Macro to Run

I know that i can set up Windows to run Excel at a certain time everyday or
week or what ever. I am wondering if there is a way to schedule excel to
open a file and execute a macro at a certain time each week.

Thanks,

Tim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Scheduling a Macro to Run


You can have windows open the excel file and have a macro in that excel
file that executes upon openning:

Private Sub Workbook_Open()

End Sub

Lost and Looking for Help Wrote:
I know that i can set up Windows to run Excel at a certain time everyday
or
week or what ever. I am wondering if there is a way to schedule excel
to
open a file and execute a macro at a certain time each week.

Thanks,

Tim



--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=542515

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Scheduling a Macro to Run

Hi Tim,

See:

http://www.cpearson.com/excel/ontime.htm


---
Regards,
Norman



"Lost and Looking for Help"
wrote in message
...
I know that i can set up Windows to run Excel at a certain time everyday or
week or what ever. I am wondering if there is a way to schedule excel to
open a file and execute a macro at a certain time each week.

Thanks,

Tim



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Scheduling a Macro to Run

the workbook_Open event will fire when a workbook is opened, so put your code
in the workbook_open event and use the windows scheduler to have excel open
and open the workbook

Excel.Exe "C:\MyFolder\Myfile.xls"

runs excel and opens Myfile.xls

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"Lost and Looking for Help" wrote:

I know that i can set up Windows to run Excel at a certain time everyday or
week or what ever. I am wondering if there is a way to schedule excel to
open a file and execute a macro at a certain time each week.

Thanks,

Tim

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Scheduling a Macro to Run

I would like to schedule the event to run at about 4:00 am. How can i have
it set up to run automatically if the time is between 4am and 5 am and run
manually if it is any other time? I just made up this code but it obviously
doesn't work

Sub Workbook_Open()
If Time 3 and Time < 5 Then Call CommandButton1_Click
Else
End Sub


CommandButton1_Click is the Sub that runs the program


"Tom Ogilvy" wrote:

the workbook_Open event will fire when a workbook is opened, so put your code
in the workbook_open event and use the windows scheduler to have excel open
and open the workbook

Excel.Exe "C:\MyFolder\Myfile.xls"

runs excel and opens Myfile.xls

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"Lost and Looking for Help" wrote:

I know that i can set up Windows to run Excel at a certain time everyday or
week or what ever. I am wondering if there is a way to schedule excel to
open a file and execute a macro at a certain time each week.

Thanks,

Tim



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Scheduling a Macro to Run

I would like to schedule the event to run at about 4:00 am. How can i have
it set up to run automatically if the time is between 4am and 5 am and run
manually if it is any other time? I just made up this code but it obviously
doesn't work

Sub Workbook_Open()
If Time 3 and Time < 5 Then Call CommandButton1_Click
Else
End Sub


CommandButton1_Click is the Sub that runs the program

"Ikaabod" wrote:


You can have windows open the excel file and have a macro in that excel
file that executes upon openning:

Private Sub Workbook_Open()

End Sub

Lost and Looking for Help Wrote:
I know that i can set up Windows to run Excel at a certain time everyday
or
week or what ever. I am wondering if there is a way to schedule excel
to
open a file and execute a macro at a certain time each week.

Thanks,

Tim



--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=542515


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Scheduling a Macro to Run

Sub Workbook_Open()
If Time TimeSerial(3,0,0) and Time < TimeSerial(5,0,0) Then
MyMacro
End if
End Sub

? timeserial(3,0,0)
3:00:00 AM

I would put the code in a general module and have the commandbutton call
that macro as well.

Private Sub commandButton1_click()
MyMacro
End Sub


--
Regards,
Tom Ogilvy



"Lost and Looking for Help" wrote:

I would like to schedule the event to run at about 4:00 am. How can i have
it set up to run automatically if the time is between 4am and 5 am and run
manually if it is any other time? I just made up this code but it obviously
doesn't work

Sub Workbook_Open()
If Time 3 and Time < 5 Then Call CommandButton1_Click
Else
End Sub


CommandButton1_Click is the Sub that runs the program


"Tom Ogilvy" wrote:

the workbook_Open event will fire when a workbook is opened, so put your code
in the workbook_open event and use the windows scheduler to have excel open
and open the workbook

Excel.Exe "C:\MyFolder\Myfile.xls"

runs excel and opens Myfile.xls

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"Lost and Looking for Help" wrote:

I know that i can set up Windows to run Excel at a certain time everyday or
week or what ever. I am wondering if there is a way to schedule excel to
open a file and execute a macro at a certain time each week.

Thanks,

Tim

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scheduling Matt Excel Discussion (Misc queries) 0 May 13th 10 05:34 AM
Scheduling SteveD Excel Worksheet Functions 1 March 18th 08 06:15 PM
scheduling mittymun Excel Worksheet Functions 8 January 30th 07 02:43 AM
Scheduling Adam R via OfficeKB.com Excel Discussion (Misc queries) 1 July 15th 05 10:30 PM
Scheduling a Macro Jeff M[_3_] Excel Programming 0 August 18th 03 03:03 PM


All times are GMT +1. The time now is 04:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"