Automatically run macro daily without opening any workbooks
up vote
2
down vote
favorite
I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook).
Is this possible? I would like to be more efficient instead of running multiple macros every morning.
Let me know if you need more info but my code would simply be a copy/paste process:
Sub MyMacro()
Application.ScreenUpdating = False
Dim OH As Workbook
Dim PO As Workbook
Set OH = Workbooks.Open("filepath")
Set PO = Workbooks.Open("filepath2")
'clear sheet
ThisWorkbook.Sheets("OH").Range("A2:O10000").ClearContents
'clear other sheet
ThisWorkbook.Sheets("OP").Range("A2:AG10000").ClearContents
'Paste new data
OH.Sheets("OH").Range("B3:P10000").Copy
Destination:=ThisWorkbook.Sheets("OH").Range("A2")
PO.Sheets("OP").Range("A3:AG20000").Copy
Destination:=ThisWorkbook.Sheets("OP").Range("A2")
OH.Close savechanges:=False
PO.Close savechanges:=False
'Refresh all pivot tables
Dim PT As PivotTable
Dim WST As Worksheet
For Each WST In ThisWorkbook.Worksheets
For Each PT In WST.PivotTables
PT.RefreshTable
Next PT
Next WST
'Clear last sheet
ThisWorkbook.Sheets("Pivot1 paste").Range("A6:E10000").ClearContents
ThisWorkbook.Sheets("Pivot1").Range("A6:D10000").Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Range("A6")
'Paste variable column to last sheet
Dim cell As Range
For Each cell In ThisWorkbook.Sheets("Pivot1").Range("E3:AZ6")
If cell.Value = "Out" Then cell.EntireColumn.Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Columns(5)
Next
'Save with current date and close
ThisWorkbook.SaveAs ("TargetFilepath")
& ".xlsm")
ThisWorkbook.Close
Application.ScreenUpdating = True
End Sub
excel vba excel-vba
add a comment |
up vote
2
down vote
favorite
I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook).
Is this possible? I would like to be more efficient instead of running multiple macros every morning.
Let me know if you need more info but my code would simply be a copy/paste process:
Sub MyMacro()
Application.ScreenUpdating = False
Dim OH As Workbook
Dim PO As Workbook
Set OH = Workbooks.Open("filepath")
Set PO = Workbooks.Open("filepath2")
'clear sheet
ThisWorkbook.Sheets("OH").Range("A2:O10000").ClearContents
'clear other sheet
ThisWorkbook.Sheets("OP").Range("A2:AG10000").ClearContents
'Paste new data
OH.Sheets("OH").Range("B3:P10000").Copy
Destination:=ThisWorkbook.Sheets("OH").Range("A2")
PO.Sheets("OP").Range("A3:AG20000").Copy
Destination:=ThisWorkbook.Sheets("OP").Range("A2")
OH.Close savechanges:=False
PO.Close savechanges:=False
'Refresh all pivot tables
Dim PT As PivotTable
Dim WST As Worksheet
For Each WST In ThisWorkbook.Worksheets
For Each PT In WST.PivotTables
PT.RefreshTable
Next PT
Next WST
'Clear last sheet
ThisWorkbook.Sheets("Pivot1 paste").Range("A6:E10000").ClearContents
ThisWorkbook.Sheets("Pivot1").Range("A6:D10000").Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Range("A6")
'Paste variable column to last sheet
Dim cell As Range
For Each cell In ThisWorkbook.Sheets("Pivot1").Range("E3:AZ6")
If cell.Value = "Out" Then cell.EntireColumn.Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Columns(5)
Next
'Save with current date and close
ThisWorkbook.SaveAs ("TargetFilepath")
& ".xlsm")
ThisWorkbook.Close
Application.ScreenUpdating = True
End Sub
excel vba excel-vba
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook).
Is this possible? I would like to be more efficient instead of running multiple macros every morning.
Let me know if you need more info but my code would simply be a copy/paste process:
Sub MyMacro()
Application.ScreenUpdating = False
Dim OH As Workbook
Dim PO As Workbook
Set OH = Workbooks.Open("filepath")
Set PO = Workbooks.Open("filepath2")
'clear sheet
ThisWorkbook.Sheets("OH").Range("A2:O10000").ClearContents
'clear other sheet
ThisWorkbook.Sheets("OP").Range("A2:AG10000").ClearContents
'Paste new data
OH.Sheets("OH").Range("B3:P10000").Copy
Destination:=ThisWorkbook.Sheets("OH").Range("A2")
PO.Sheets("OP").Range("A3:AG20000").Copy
Destination:=ThisWorkbook.Sheets("OP").Range("A2")
OH.Close savechanges:=False
PO.Close savechanges:=False
'Refresh all pivot tables
Dim PT As PivotTable
Dim WST As Worksheet
For Each WST In ThisWorkbook.Worksheets
For Each PT In WST.PivotTables
PT.RefreshTable
Next PT
Next WST
'Clear last sheet
ThisWorkbook.Sheets("Pivot1 paste").Range("A6:E10000").ClearContents
ThisWorkbook.Sheets("Pivot1").Range("A6:D10000").Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Range("A6")
'Paste variable column to last sheet
Dim cell As Range
For Each cell In ThisWorkbook.Sheets("Pivot1").Range("E3:AZ6")
If cell.Value = "Out" Then cell.EntireColumn.Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Columns(5)
Next
'Save with current date and close
ThisWorkbook.SaveAs ("TargetFilepath")
& ".xlsm")
ThisWorkbook.Close
Application.ScreenUpdating = True
End Sub
excel vba excel-vba
I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook).
Is this possible? I would like to be more efficient instead of running multiple macros every morning.
Let me know if you need more info but my code would simply be a copy/paste process:
Sub MyMacro()
Application.ScreenUpdating = False
Dim OH As Workbook
Dim PO As Workbook
Set OH = Workbooks.Open("filepath")
Set PO = Workbooks.Open("filepath2")
'clear sheet
ThisWorkbook.Sheets("OH").Range("A2:O10000").ClearContents
'clear other sheet
ThisWorkbook.Sheets("OP").Range("A2:AG10000").ClearContents
'Paste new data
OH.Sheets("OH").Range("B3:P10000").Copy
Destination:=ThisWorkbook.Sheets("OH").Range("A2")
PO.Sheets("OP").Range("A3:AG20000").Copy
Destination:=ThisWorkbook.Sheets("OP").Range("A2")
OH.Close savechanges:=False
PO.Close savechanges:=False
'Refresh all pivot tables
Dim PT As PivotTable
Dim WST As Worksheet
For Each WST In ThisWorkbook.Worksheets
For Each PT In WST.PivotTables
PT.RefreshTable
Next PT
Next WST
'Clear last sheet
ThisWorkbook.Sheets("Pivot1 paste").Range("A6:E10000").ClearContents
ThisWorkbook.Sheets("Pivot1").Range("A6:D10000").Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Range("A6")
'Paste variable column to last sheet
Dim cell As Range
For Each cell In ThisWorkbook.Sheets("Pivot1").Range("E3:AZ6")
If cell.Value = "Out" Then cell.EntireColumn.Copy
Destination:=ThisWorkbook.Sheets("Pivot1 paste").Columns(5)
Next
'Save with current date and close
ThisWorkbook.SaveAs ("TargetFilepath")
& ".xlsm")
ThisWorkbook.Close
Application.ScreenUpdating = True
End Sub
excel vba excel-vba
excel vba excel-vba
edited Nov 19 at 18:47
TylerH
15.3k105067
15.3k105067
asked Nov 9 at 17:28
user10101843
266
266
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01
add a comment |
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
VBA is made to work within Microsoft Office, but you can leverage VB Script to open a workbook and run a macro.
Place the following in a .vbs file. You will create a schedule to call and execute this file. Make sure to set the correct path and edit "test.xlsm!mymacro" to the name of your workbook and the macro you wish to call.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:pathtotest.xlsm")
objExcel.Application.Run "test.xlsm!mymacro"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
To test this, I created a quick macro in test.xlsm to create a text file in the same directory and verified that it was there after I ran the VB Script. There is nothing special about the macro below, you can call whatever macro you desire. This will save you from having to manually open the workbook and run the macro.
Sub mymacro()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:UsersbcohanDownloadstesting.txt")
oFile.WriteLine "test"
oFile.Close
Set fso = Nothing
Set oFile = Nothing
End Sub
Once you have the above working, you should be able to create a scheduled task in windows to run your script.
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with asubandend sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.
– user10101843
Nov 19 at 18:39
|
show 3 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230625%2fautomatically-run-macro-daily-without-opening-any-workbooks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
VBA is made to work within Microsoft Office, but you can leverage VB Script to open a workbook and run a macro.
Place the following in a .vbs file. You will create a schedule to call and execute this file. Make sure to set the correct path and edit "test.xlsm!mymacro" to the name of your workbook and the macro you wish to call.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:pathtotest.xlsm")
objExcel.Application.Run "test.xlsm!mymacro"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
To test this, I created a quick macro in test.xlsm to create a text file in the same directory and verified that it was there after I ran the VB Script. There is nothing special about the macro below, you can call whatever macro you desire. This will save you from having to manually open the workbook and run the macro.
Sub mymacro()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:UsersbcohanDownloadstesting.txt")
oFile.WriteLine "test"
oFile.Close
Set fso = Nothing
Set oFile = Nothing
End Sub
Once you have the above working, you should be able to create a scheduled task in windows to run your script.
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with asubandend sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.
– user10101843
Nov 19 at 18:39
|
show 3 more comments
up vote
6
down vote
accepted
VBA is made to work within Microsoft Office, but you can leverage VB Script to open a workbook and run a macro.
Place the following in a .vbs file. You will create a schedule to call and execute this file. Make sure to set the correct path and edit "test.xlsm!mymacro" to the name of your workbook and the macro you wish to call.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:pathtotest.xlsm")
objExcel.Application.Run "test.xlsm!mymacro"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
To test this, I created a quick macro in test.xlsm to create a text file in the same directory and verified that it was there after I ran the VB Script. There is nothing special about the macro below, you can call whatever macro you desire. This will save you from having to manually open the workbook and run the macro.
Sub mymacro()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:UsersbcohanDownloadstesting.txt")
oFile.WriteLine "test"
oFile.Close
Set fso = Nothing
Set oFile = Nothing
End Sub
Once you have the above working, you should be able to create a scheduled task in windows to run your script.
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with asubandend sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.
– user10101843
Nov 19 at 18:39
|
show 3 more comments
up vote
6
down vote
accepted
up vote
6
down vote
accepted
VBA is made to work within Microsoft Office, but you can leverage VB Script to open a workbook and run a macro.
Place the following in a .vbs file. You will create a schedule to call and execute this file. Make sure to set the correct path and edit "test.xlsm!mymacro" to the name of your workbook and the macro you wish to call.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:pathtotest.xlsm")
objExcel.Application.Run "test.xlsm!mymacro"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
To test this, I created a quick macro in test.xlsm to create a text file in the same directory and verified that it was there after I ran the VB Script. There is nothing special about the macro below, you can call whatever macro you desire. This will save you from having to manually open the workbook and run the macro.
Sub mymacro()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:UsersbcohanDownloadstesting.txt")
oFile.WriteLine "test"
oFile.Close
Set fso = Nothing
Set oFile = Nothing
End Sub
Once you have the above working, you should be able to create a scheduled task in windows to run your script.
VBA is made to work within Microsoft Office, but you can leverage VB Script to open a workbook and run a macro.
Place the following in a .vbs file. You will create a schedule to call and execute this file. Make sure to set the correct path and edit "test.xlsm!mymacro" to the name of your workbook and the macro you wish to call.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:pathtotest.xlsm")
objExcel.Application.Run "test.xlsm!mymacro"
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
To test this, I created a quick macro in test.xlsm to create a text file in the same directory and verified that it was there after I ran the VB Script. There is nothing special about the macro below, you can call whatever macro you desire. This will save you from having to manually open the workbook and run the macro.
Sub mymacro()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile("C:UsersbcohanDownloadstesting.txt")
oFile.WriteLine "test"
oFile.Close
Set fso = Nothing
Set oFile = Nothing
End Sub
Once you have the above working, you should be able to create a scheduled task in windows to run your script.
edited Nov 19 at 18:45
answered Nov 9 at 17:52
Brian Cohan
1,8481821
1,8481821
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with asubandend sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.
– user10101843
Nov 19 at 18:39
|
show 3 more comments
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with asubandend sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.
– user10101843
Nov 19 at 18:39
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
Ok, thank you this is very helpful. I will try to set this up for myself and if I have any questions for setting up in the process I will refer to this thread.
– user10101843
Nov 9 at 18:30
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I actually do have an important follow-up question: Does my computer have to be on ( not on sleep mode or shut off) for the scheduled macro to run?
– user10101843
Nov 9 at 21:53
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
I'm more of a linux guy, so I know in linux, if a cronjob is missed, the computer will run them when it wakes. So you might get hammered once you boot the machine, but yes, the computer has to be on in one way or another for it to run. Depending on the nature and significance of the macro, if you're using this for work, you may be able to see if there's a way to execute it from another machine that is always on.
– Brian Cohan
Nov 9 at 21:55
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Ok I see, and that could be a good idea. Thank you
– user10101843
Nov 9 at 22:00
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with a
sub and end sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.– user10101843
Nov 19 at 18:39
Hello, I have a couple of elementary questions: 1) Would I put the first script in a blank workbook with a
sub and end sub? 2) Would the same follow for the second script, and would I create the scheduled task off of the first script? If so, what is the significance of the text file? Thank you, just want to make sure I grasp what is occurring.– user10101843
Nov 19 at 18:39
|
show 3 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230625%2fautomatically-run-macro-daily-without-opening-any-workbooks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See also Run Excel macro from outside Excel using VbScript from command line
– T.M.
Dec 9 at 16:01