
That’s because we didn’t add a workbook to our instance of Excel in a case like that, when you don’t add a workbook, Excel automatically terminates at the same time the script terminates.
#Set autosave in word 2016 code#
Want to autosave every 20 minutes? No problem just use this code instead: = 20Īnd that’s all we have to do we don’t even have to call the Quit method and explicitly dismiss Excel. Next we set the value of the AutoRecover.Time property to 5 which, needless to say, sets the autosave interval to 5 minutes. What if you want to disable autosave? You got it: just set Autorecover.Enabled to False: = False To begin with, we set the value of the AutoRecover.Enabled property to True that simply makes sure that autosave is actually enabled. But if you’d like to see Excel anyway, just so you know that something is happening, then make this the second line of code in the script: objExcel.Visible = trueĪfter creating our instance of Excel we then configure two different property values. Why not? Because configuring the autosave time is going to take only a split second it just seemed silly to show Excel onscreen and then immediately make it disappear.

In this script, however, we don’t bother setting the Visible property to True.

We start out by creating an instance of the Excel.Application object. So what the heck: if you have time to compete in the 2007 Scripting Games and to configure Excel to autosave every 5 minutes, well, we’ll do what we can to help you out: Set objExcel = CreateObject("Excel.Application")Īs you can see, this is a simple-enough little script, even for the Scripting Guys (who really did think that the events in last year’s Scripting Games were challenging). And no doubt many of you wrote those scripts with one hand tied behind your backs to boot. Those concerns were answered soon enough: just a few hours into day 1 of the 2006 Games we’d already received 300 completed (and correct) entries. Last year, during the inaugural Scripting Games, we worried about whether we had made the events too hard and whether we gave people enough time to write their scripts. On the other hand, KK, you’re probably one of those people who have already finished every event in every division. Scripto bobblehead by reading this column, that’s for sure. That’s an opportunity that only comes once a year, which means you don’t want to miss it.īesides, you aren’t going to win a Dr. Um, not that Hey, Scripting Guy! is a waste of time, mind you it’s just that the Scripting Games are special: after all, they represent the opportunity for you to match your scripting skills with script writers from all around the world.

Quit wasting your time and get going on the Games! As it turns out, the autosave capability in Microsoft Excel – hey, wait a minute: do you realize what day it is? Today is the first day of the 2007 Winter Scripting Games why in the world are you reading the Hey, Scripting Guy! column?!? After all, even as we speak you should be writing a script that calculates the Chinese astrological year or unscrambling scrambled scripting terms.

Hey, Scripting Guy! How can I configure Office Excel to autosave every 5 minutes?
