Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any idea how to have fetch file automatically fetch the data at say; 7:30 AM
every weekday? Right now I have to push a button but may not always be here throughout the day to do it and I would hate to miss a days worth of data or more if I happen to be on vacation. I normally press a button in cell A1 of the sheet to activate this macro. -- Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doug,
You could do that with application.ontime privideing the workbook was open of course. This bit of code to get things started Private Sub Workbook_Open() Application.OnTime TimeValue("07:30:00"), "YourMacro" End Sub then this in a 'general Module' to make it continue to work every weekday at 07:30 Sub YourMacro() Application.OnTime TimeValue ("07:30:00"), "MyMacro" If Weekday(Now, 2) 5 Then Exit Sub 'YOUR CODE End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Doug" wrote: Any idea how to have fetch file automatically fetch the data at say; 7:30 AM every weekday? Right now I have to push a button but may not always be here throughout the day to do it and I would hate to miss a days worth of data or more if I happen to be on vacation. I normally press a button in cell A1 of the sheet to activate this macro. -- Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to do it with the workbook closed? I would rather not even
open the workbook unless I find that there is something wrong with the data that I pull from it in another workbook. -- Thank you! "Mike H" wrote: Doug, You could do that with application.ontime privideing the workbook was open of course. This bit of code to get things started Private Sub Workbook_Open() Application.OnTime TimeValue("07:30:00"), "YourMacro" End Sub then this in a 'general Module' to make it continue to work every weekday at 07:30 Sub YourMacro() Application.OnTime TimeValue ("07:30:00"), "MyMacro" If Weekday(Now, 2) 5 Then Exit Sub 'YOUR CODE End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Doug" wrote: Any idea how to have fetch file automatically fetch the data at say; 7:30 AM every weekday? Right now I have to push a button but may not always be here throughout the day to do it and I would hate to miss a days worth of data or more if I happen to be on vacation. I normally press a button in cell A1 of the sheet to activate this macro. -- Thank you! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use Task Scheduler to start Excel and open the workbook every day at a
designated time. You will have workbook_open code which fetches the data then saves and closes the workbook then shuts down Excel. Like 4:30AM when no one will be around and using Excel. Gord Dibben MS Excel MVP On Mon, 24 May 2010 11:18:04 -0700, Doug wrote: Is there a way to do it with the workbook closed? I would rather not even open the workbook unless I find that there is something wrong with the data that I pull from it in another workbook. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once I set it like this, how can I stop the macro if I need to look at the
workbook? -- Thank you! "Gord Dibben" wrote: Use Task Scheduler to start Excel and open the workbook every day at a designated time. You will have workbook_open code which fetches the data then saves and closes the workbook then shuts down Excel. Like 4:30AM when no one will be around and using Excel. Gord Dibben MS Excel MVP On Mon, 24 May 2010 11:18:04 -0700, Doug wrote: Is there a way to do it with the workbook closed? I would rather not even open the workbook unless I find that there is something wrong with the data that I pull from it in another workbook. . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code doesn't close the workbook after it runs the application. Do you
know what I should have in there instead? Application.Run "KingWebFetchSAS.xls!GetDataSAS" ActiveWorkbook.RunAutoMacros Which:=xlAutoClose -- Thank you! "Gord Dibben" wrote: Use Task Scheduler to start Excel and open the workbook every day at a designated time. You will have workbook_open code which fetches the data then saves and closes the workbook then shuts down Excel. Like 4:30AM when no one will be around and using Excel. Gord Dibben MS Excel MVP On Mon, 24 May 2010 11:18:04 -0700, Doug wrote: Is there a way to do it with the workbook closed? I would rather not even open the workbook unless I find that there is something wrong with the data that I pull from it in another workbook. . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you!
This code doesn't close the workbook after it runs the application. Do you know what I should have in written instead to close the workbook? Application.Run "KingWebFetchSAS.xls!GetDataSAS" ActiveWorkbook.RunAutoMacros Which:=xlAutoClose -- Thank you! "Mike H" wrote: Doug, You could do that with application.ontime privideing the workbook was open of course. This bit of code to get things started Private Sub Workbook_Open() Application.OnTime TimeValue("07:30:00"), "YourMacro" End Sub then this in a 'general Module' to make it continue to work every weekday at 07:30 Sub YourMacro() Application.OnTime TimeValue ("07:30:00"), "MyMacro" If Weekday(Now, 2) 5 Then Exit Sub 'YOUR CODE End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Doug" wrote: Any idea how to have fetch file automatically fetch the data at say; 7:30 AM every weekday? Right now I have to push a button but may not always be here throughout the day to do it and I would hate to miss a days worth of data or more if I happen to be on vacation. I normally press a button in cell A1 of the sheet to activate this macro. -- Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
.OnEntry Macro does not fire when pasting | Excel Programming | |||
ListBox Selection to fire Macro | Excel Programming | |||
Fire Macro from Cell Change | Excel Worksheet Functions | |||
fire macro on AutoFilter change | Excel Programming | |||
how to get onkey macro to fire while another macro is running | Excel Programming |