If someone could help out, be appreciated. I have used the code below for an excel document at work for a number of years but we updated to microsoft 2010 and I am getting error on the "ThisWorkbook.SaveAs Filename:="S:\Early Years Unit\Joint EarlyYears\NoEntryToFile\2013\SpringSummer2013\" & MyTime & "-" & ThisWorkbook.Name" indicating the SaveAs object failed.
Also the second block of code on the Workbook_open is showing error when I step into but there seems to be no reason.
Also the second block of code on the Workbook_open is showing error when I step into but there seems to be no reason.
Code:
Public Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Save
Dim Msg As String
Dim ans As Integer
Dim fname As String
Dim MyTime As String
MyTime = Format(Now, "mmmm-d-yyyy-hhmmss")
Msg = "Would you like to back up file?"
ans = MsgBox(Msg, vbYesNo)
If ans = vbYes Then
ThisWorkbook.SaveAs Filename:="S:\Early Years Unit\Joint EarlyYears\NoEntryToFile\2013\SpringSummer2013\" & MyTime & "-" & ThisWorkbook.Name
End If
End Sub
Code:
Public Sub Workbook_Open()
Sheets("Full List of Workshops").Select
End Sub