Autorun Excel / Macro on schedule - excel

I have a workbook that contains a macro that I would like to run once a week automatically.
I have set up the workbook_open event to run the macro and the code itself runs as I would like it to.
My question is how to schedule this to automatically run on a schedule. I have setup a task in windows task scheduler which does not seem to run reliably (i've tried this on a few different projects over the years and never get great results).
My desire is to have my personal desktop run this task whether or not I am logged in. (Obviously the computer needs to be powered on which is no problem. Also, I am the only one that uses this computer, no concern about someone else being logged in)
Is there a more robust way of doing this or am I stuck with task scheduler? If so, has anyone else had better success with it that might be able to help me out?
Task scheduler seems to work only intermittently although the "history" shows it is triggered and run at the desired times. Part of the code saves a file to a location with a date stamp and there are not files for each trigger in the scheduler history.

When logged off , the task is executed without loading the user profile.
Maybe this is the answer for you.
It's Japanese. Can you use google translate?
enter link description here
You have to make the directory.
If you use 32bit Excel : %SystemRoot%\System32\config\systemprofile\Desktop
If you use 64bit Excel : %SystemRoot%\SysWOW64\config\systemprofile\Desktop

For anyone that might run across this. I've been using a 3rd party task scheduler which is much more reliable in my experience. There are many out there but i use robointern. robointern website

Related

Python automation project to run in the background

i just started working with python and with some scripts to automate some tasks. I manage to create a web scraper using selenium that notifies me daily with the latest news via a mail . Now the script works great if i run it manually , but my question is : How can i make the script to run automatically every day , and what option would you recomand . I know that you can use TaskScheduler and program it , but i was wondering if you know any options to run it directly in the cloud ? Also , i found some tutorials where they say to wrap all the code in an infinite loop and add a timer , and once you run the script it will stay active as a background process,
I just started working with scripts and automation , so i would really like to know your opinion on the best way to run the script automatically . Thanks a lot
If this is on a unix-based OS, check out cron (this is a pretty good guide). You can schedule it to run your python script daily.
Im not sure if that is what you are looking for, but (if you are on windows) you could attach your program to your autostart. Probably your Startup Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
If you schedule in your computer, i think it may not be proper solution. It's better to deploy it on any cloud platforms & schedule at any particular time.
I personally suggest Heroku, I'm using it for running multiple scripts for free. You can use scheduler addon for scheduling scripts to run at particular time as well. Please refer to heroku documentation & get started! Note: The script may run more time than you expected, please refer here to fix this.

Python script works for one user, but not another on same machine

Another team created python scripts within our organization for my team to run. Up until two weeks ago, we all ran them without any problems. Then one day, some users have been unable to run them successfully on the same machine.
All users are admins with LUA disabled. All users should have the same permissions.
The complicating factor here is the team created a "framework" which generates code from a combination of the framework, and an excel file for the tests being run. This prevents me from stepping through the code and finding where it's specifically failing. Beyond that, the same exact script runs on the same machine when another user trying to run it.
Specifically, in the script, it appears that when the affected users are running the script, IEDriverserver doesn't appear to open. No errors are given.
Is there any environmental variables that could be specific to users that would cause this? Even a direction to look would be extremely helpful.
Does it always fail in the same part of the Python code? Does opening the Excel file have anything to do with it, perhaps? I mean, if someone has the Excel file open on a network drive, and someone else is trying to write to the file, i'm pretty sure this will trigger an error, unless the Excel file is 'shared'. Just a couple thoughts.
I encountered the similar issue today. I happen to solve it by unset PYTHONHOME and PYTHONPATH. Not sure if this helps.

Create scheduled task in scheduled task that runs power shell script

I am struggling to create scheduled task that will execute power shell script.
I found only the documentation that not help if you do this for the first time.
Can anyone point me to the right place.
Thanks.
I do not really understand what exactly is your problem.But i developed a scheduled task for install shield before a month, using the Automation Interface that Flexera provides.
Install Shield 2012 Automation Interface
In the page above you will find how to open a current project or create a new one and after you manage all the project properties with the provided API through your program.
I found it easier to create a project from the GUI so i can use it as a Template after and just modify it from my program to fit my needs for every new project that i wanted to release.It was easier like this because i had only to modify the version and put new sources inside.
I hope i provided you with some new information,otherwise let me now if i misunderstood you and tell me what exactly is your problem so i can assist you better :)
Best Regards

Gmail meter (Google apps script) sends error notifications even after deleting the file with script

I've installed Gmail Meter script in Google Documents and launched it. It demanded many permissions and access to many google account elements. Script works quite slowly and meanwhile I decided to take back those permissions because they were too wide. An hour later I got mail notification about error, script cannot work without permissions.
I tried to turn off this working script but didn't find the way so I deleted (permanently) the file in which I installed the script. Since then I get every day 3 error notifications. I can turn off them (there is a link in a mail) but I'm more interested in terminating the script? What should I do?
Indeed the triggers should be terminated once the spreadsheet has been moved to trash. This is a known issue:
Issue 143: Spreadsheets with time triggered scripts should no longer trigger when spreadsheet is deleted
You can star this issue and turn the triggers off via the link in the email.
You can access all your script projects by opening the script editor and selecting Resources > All your triggers. Find the triggers you want to delete and click the 'x' icon next to them.
You should delete the triggers ...

Coded UI Tests automation

I want to automate the process of running coded UI tests.
Do i need to have user logged in to the system?
Or is it possible to run it using XYNT service?
We are able to run our coded ui tests in an automated fashion using windows scheduler and the command line MSTest.exe. Take a look at the following MSDN article on how to accomplish this:
http://msdn.microsoft.com/en-us/library/ms182486.aspx
I believe you can use Microsoft's Test Manager to accomplish this as well but we don't have TFS (yet) so I can't vouch for it.
As far as I know, CodedUI Tests require an active desktop session, so running them under a service account without an open desktop session may work, but not without a session.
I used the mstest to run the coded ui test and use Windows TaskScheduler to schedule the test.
You can find detail in MSTest.exe command-line documentation.
When you want to run it automatically, there are two things you should pay attention:
1. Set auto log on
2. Close the screen saver
You need to take the snapshot of your enviroment with user logged in and then you can run your test through MS Test Manager or TFS (nightly build process)
Write the test's in Visual Studio 2010/2012, this means you can manually edit the test's the code, then you should run them in Test Manager,
BTW you need TFS and Test Manager to be the same year otherwise it won't work.
I've being doing a lot of these recently if you have any questions post it online and send me a message, I'll be happy to help.

Resources