I have a couple of spreadsheets that run some validation code when the 'BeforeSave' event is triggered. With the new autosave functionality (saving the document to Sharepoint on a very frequent basis), this causes two problems; (a) the code errors out, because the save still happens with the spreadsheet not active (.find methods don't work); and (b) I don't really want the code to run very frequently, as it takes a small but noticeable amount of time.
The problem can be solved just by manually switching off the autosave for these sheets, but this is not ideal (as new copies are saved of each every week and the autosave has to be turned off again, and in any case it is useful functionality). I could probably rewrite the code to solve (a), activating the sheet if nothing else, but this wouldn't be ideal, and would still leave the problem of (b) to deal with.
Is there anyway to detect if the BeforeSave event is triggering from an AutoSave or from a manual save? Or some other way of having an event trigger only on a manual save, and not on an autosave?
Thanks,
TC
The problem can be solved just by manually switching off the autosave for these sheets, but this is not ideal (as new copies are saved of each every week and the autosave has to be turned off again, and in any case it is useful functionality). I could probably rewrite the code to solve (a), activating the sheet if nothing else, but this wouldn't be ideal, and would still leave the problem of (b) to deal with.
Is there anyway to detect if the BeforeSave event is triggering from an AutoSave or from a manual save? Or some other way of having an event trigger only on a manual save, and not on an autosave?
Thanks,
TC