First of all, I really need to say, I love this forum!
I love the way you can search, make favourite threads, the replies, I love it all!
(so much for the sucking up, now i need help! ;-))
After having read about 20 threads, i still can't seem to find/create the right code.
What i want to do is create an autobackup macro that will run in the background of a shared excel workbook (it's a bookinglist at our gym. Several people can book in appointments with the various trainers, so we don't want to miss info through it crashing, thus double booking people)
As we are on terminal servers with lots of limitations, i want to create a macro that saves the file, say bookinglist.xls to a directory named \backup\bookinglistbackup.xls.
The code i have so far is:
what i need help with is automating this so it runs say twice a day, and making this macro run in the background as soon as it's opened....
Please accompany code with comments as i am a complete VBA newb, physical therapist, dutch, and a guy to boot...
All help appreciated..
I love the way you can search, make favourite threads, the replies, I love it all!
(so much for the sucking up, now i need help! ;-))
After having read about 20 threads, i still can't seem to find/create the right code.
What i want to do is create an autobackup macro that will run in the background of a shared excel workbook (it's a bookinglist at our gym. Several people can book in appointments with the various trainers, so we don't want to miss info through it crashing, thus double booking people)
As we are on terminal servers with lots of limitations, i want to create a macro that saves the file, say bookinglist.xls to a directory named \backup\bookinglistbackup.xls.
The code i have so far is:
Code:
Sub autobackup()
ActiveWorkbook.AcceptAllChanges Who:="Everyone"
' not sure this one works as i get an error message when it's not shared but cant run vba when it's shared.... no errors on running it in shared mode though...
Application.DisplayAlerts = False
Workbooks("bookinglist.XLS").Save
'to first save the current changes
Workbooks("bookinglist.XLS").SaveAs Filename:="\backup\bookinglist.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=True
' saves the backup file
Application.DisplayAlerts = True
Workbooks.Open "G:\Felles\Fitness
Flor\stijn\kondis.xls"
'opens the original again since we reverted to the backup file
Workbooks("kondisbackup.XLS").Close SaveChanges:=False
'closes the backup
End Sub
Please accompany code with comments as i am a complete VBA newb, physical therapist, dutch, and a guy to boot...
All help appreciated..