Dear expert,
How can we write vba code into a workbook which has option and timeset. The user only open that workbook and choose which workbook want to be auto save (active workbook, all workbook, or a specific workbook) and input time interval to start auto save...left it open and it will save all data automatically?
Regards,
Hi rathanak,
why don't you use the built in auto save features, rather than write VBA to do this?
Regards
Phil
Hi Phil ,
could you give me guide to built in auto save features?
Regards,
Rathanak
Hi Rathanak,
You can use one of Microsoft code samples:
Sub SaveAll() ' Store the Activeworkbook in a variable. Set aw = ActiveWorkbook For Each wb In Workbooks If wb.Path <> "" Then ' Save file if it has been saved ' previously wb.Save Else ' If not previously saved, activate and show the ' Save As dialog box. wb.Activate Application.Dialogs(xlDialogSaveAs).Show End If Next aw.Activate ' Activate the original Activeworkbook. End Sub
You can change the code to make it work as you want, but as Phil said, it's better if you use the built in save features. See the image below for Auto Save settings.
Catalin, thanks