In this setup I see that the workbook is opened the macro is run, but now we need to save and close the workbook manually. How can this be done automatically so that it is ready to be opened for the next scheduled run and then automatically saved and closed again?
This is great! why do I need to use a .bat file? It works fine with the .vbs straight into task scheduler and then there is no command prompt pop up window
Hi there, can I do this with a Sharepoint excel file? The snag I am encountering is that it's in my file explorer and when I go to Properties, I don't see the security tab, so I can't grab the Object name. Help! - Thanks!
Good info! So within Excel there are also options available to set up certain triggers to run a Macro (Like when opening Excel workbook, or running it just before closing an Excel workbook, etc.) Are those Excel macro task triggers just very restricted compared to this method? Does this option setting it up through your pc's task scheduler give you more options when you can run the task, for example, enabling your pc to run the task even if your pc is shut-off?
Yeah basically that’s section of code that won’t run unless that very specific event happened. This one is more broad in the sense that I can have script run from the command line.
I am getting the error message from windows script host as Sorry, we couldn't find , is it possible it was moved or renamed? I specified the correct file location in the code. I am able to open the file through command prompt. How to fix this error?
Hi, First of all, this is awesome!! in the end of my macro there is 2 lines that say to save and to close. The saving work but i'm getting an error when it comes to the close line. any suggesting why its happening?
Basically, we don't give any upfront information about the objects we instead wait until the program executes to give that information. This helps with compatibility issues but also the program runs slightly slower than with early binding.
@@SigmaCoding thanks. I quickly saw your other vid regarding the late-binding after sending my question....So gotta look at it again to get more info on it. Thank you!!!
Will this work for a file on a shared drive? For instance, a shared drive that you may not necessarily have set up yourself or have all permissions for. Is there any additional code needed in the macro to run on a shared drive? Or would the only difference between your video be the file paths created in the vbs and batch files and corresponding task?
This is very useful, But am getting web hosting error that .."sorry this file is not found"..could please help me.. I have placed my macro enabled excel in C\Users\ location
Hi, thanks for this. This seems to work for when you want this to occur 1 time, however if, under the triggers tab, we change this to One Time, then under this tick the box that says repeat task every, then say 5 mins for a duration of 1 day, this now does not work - could you please help?
Is there anyway to do this exact same thing with a workbook that will always be open. Rather than having Workbooks.Open() is there a Workbooks.Active or .Select?
Yes, you don't have to explicitly open the workbook. In your case, you identified it correctly, all you need to do is get the "ActiveWorkbook" or the "Workbook" you care about and then execute the code as is. However, be careful because it can be problematic working with a workbook that is already open and might have some other process going on in the background.
@@SigmaCoding Hi , always have an open workbook which want to run a macro on via your .vbs. Have tried many iterations of ActiveWorkbook but cant get it to work. Could you very kindly put the context with a line that it is used? Many thanks for the great helpful tutorials on here.
It works except I have this displayed... C:\Users\asalinas\Desktop>"C:\Users\asalinas\Desktop\Welcome Script.vbs" C:\Users\asalinas\Desktop>pause Press any key to continue . . . How do I eliminate this step?
@@SigmaCoding Hi - I just want the task to happen in background without me pressing any key. Also, I would like excel file that has macro to close after it is run... thoughts?
This helped me in my job, you are a champion ! :))
tons of thanks
Awesome!!!!!!!
This is so good
Thank you for this it helped me a lot.
wow !! thanks
Excellent video. So clear and simple. Thank you very much!
Thank you very clear , How can i use it in accdb Macro cause i face errors
Thanks a lot. Great work.
Glad you liked it!
Can I run multiple macros at once using this method at various times.
Great video, super helpful. Almost 1k subs!
Getting close, just a few more and we are there!
In this setup I see that the workbook is opened the macro is run, but now we need to save and close the workbook manually. How can this be done automatically so that it is ready to be opened for the next scheduled run and then automatically saved and closed again?
Thanks alot
Great Video! Thank You so much!!!!!
Happy to share it! :)
Will it only work when using a vs code?
This is great! why do I need to use a .bat file? It works fine with the .vbs straight into task scheduler and then there is no command prompt pop up window
Hi there, can I do this with a Sharepoint excel file? The snag I am encountering is that it's in my file explorer and when I go to Properties, I don't see the security tab, so I can't grab the Object name. Help! - Thanks!
Great video, thanks! You mention it works for Outlook too, can you explain how? As far as I see it's not possible in the same way
OMG it's awesome! Thanks for sharing! Thumbs up, subscribed :)
how do i set my background like yours with the tree ?
Good info!
So within Excel there are also options available to set up certain triggers to run a Macro (Like when opening Excel workbook, or running it just before closing an Excel workbook, etc.) Are those Excel macro task triggers just very restricted compared to this method?
Does this option setting it up through your pc's task scheduler give you more options when you can run the task, for example, enabling your pc to run the task even if your pc is shut-off?
Yeah basically that’s section of code that won’t run unless that very specific event happened. This one is more broad in the sense that I can have script run from the command line.
Can the bat file run an Excel file instead of a vbs script?
What code would I add to close without saving the file? This is awesome by the way!
Just do something like the following.
xlsxWorkbook.Close()
xlsxApp.Quit()
I am getting the error message from windows script host as Sorry, we couldn't find , is it possible it was moved or renamed? I specified the correct file location in the code. I am able to open the file through command prompt. How to fix this error?
Hi, First of all, this is awesome!! in the end of my macro there is 2 lines that say to save and to close. The saving work but i'm getting an error when it comes to the close line. any suggesting why its happening?
I'm assuming you're closing an Excel workbook. What exactly does your code look like at that portion?
You mentioned 'late-binding' when speaking about the script file. What is 'late-binding' mean, exactly? If you can expand a little on that?
Basically, we don't give any upfront information about the objects we instead wait until the program executes to give that information. This helps with compatibility issues but also the program runs slightly slower than with early binding.
@@SigmaCoding thanks. I quickly saw your other vid regarding the late-binding after sending my question....So gotta look at it again to get more info on it. Thank you!!!
Will this work for a file on a shared drive? For instance, a shared drive that you may not necessarily have set up yourself or have all permissions for. Is there any additional code needed in the macro to run on a shared drive? Or would the only difference between your video be the file paths created in the vbs and batch files and corresponding task?
As far as you have access to the shared drive the script should work.
how can you schedule multiple macros in the same excel workbook?
This is very useful, But am getting web hosting error that .."sorry this file is not found"..could please help me.. I have placed my macro enabled excel in C\Users\ location
How can run my script from 9 am at every 15 min till 5 pm
Hi, thanks for this. This seems to work for when you want this to occur 1 time, however if, under the triggers tab, we change this to One Time, then under this tick the box that says repeat task every, then say 5 mins for a duration of 1 day, this now does not work - could you please help?
What is the issue you're experiencing?
@@SigmaCoding Hi, I have figured out my issue now, thank you!
Is there anyway to do this exact same thing with a workbook that will always be open. Rather than having Workbooks.Open() is there a Workbooks.Active or .Select?
Yes, you don't have to explicitly open the workbook. In your case, you identified it correctly, all you need to do is get the "ActiveWorkbook" or the "Workbook" you care about and then execute the code as is. However, be careful because it can be problematic working with a workbook that is already open and might have some other process going on in the background.
Did you get this to work? I have a workbook i keep open all day and am trying (among others) and trying to figure out how to do this.
@@SigmaCoding Hi , always have an open workbook which want to run a macro on via your .vbs. Have tried many iterations of ActiveWorkbook but cant get it to work. Could you very kindly put the context with a line that it is used? Many thanks for the great helpful tutorials on here.
Why did you not just point the task to the wscript.exe and pass the vbs as a parameter, this way you don't need the bat file .
It works except I have this displayed...
C:\Users\asalinas\Desktop>"C:\Users\asalinas\Desktop\Welcome Script.vbs"
C:\Users\asalinas\Desktop>pause
Press any key to continue . . .
How do I eliminate this step?
So you don't want to have the "pause" command? Am I understanding your question correctly?
@@SigmaCoding Hi - I just want the task to happen in background without me pressing any key. Also, I would like excel file that has macro to close after it is run... thoughts?
Instead of pause you can give exit
Very useful.Thank you so much