i am updating a book by copying another
a popup prompt "classes need to be updated do you want to update"
how do i prevent that?
i colored the line of code red where the problem happens
a popup prompt "classes need to be updated do you want to update"
how do i prevent that?
i colored the line of code red where the problem happens
Rich (BB code):
Sub GetClassesNames()
' GetClassesNames Macro
Application.ScreenUpdating = False
Dim wbApproved As Workbook
Call WSUnProtect(ActiveSheet)
Sheets("ClassesMemberships Names").Select
'Columns("A:D").ClearContents
If IsWorkBookOpen("M:\all\Rochma Jungreis\Approved Classes\Approved Classes by ABC.xlsm") = False Then
Set wbApproved = Workbooks.Open("M:\all\Rochma Jungreis\Approved Classes\Approved Classes by ABC.xlsm")
DoEvents
Else
MsgBox "Workbook 'Approved Classes by ABC' is already open. Update not allowed."
Exit Sub
End If
' Else
' Set wbApproved = Workbooks("Approved Classes by ABC.xlsm")
' End If
Workbooks("Approved Classes by ABC.xlsm").Activate
Workbooks("Approved Classes by ABC.xlsm").Worksheets("ClassesMemberships Names").Columns("A:F").Copy
DoEvents
ThisWorkbook.Activate
Worksheets("ClassesMemberships Names").Activate
Application.EnableEvents = False
Range("A:F").PasteSpecial xlPasteAll
DoEvents
Application.CutCopyMode = False
'Disable Events to prevent prompt to backup Class Book
Application.EnableEvents = False
Workbooks("Approved Classes by ABC.xlsm").Close SaveChanges:=False
Application.EnableEvents = True
Call WSProtect(ActiveSheet)
Application.ScreenUpdating = True
MsgBox "Classes/Memberships has been updated successfuly!"
End Sub