Hi guys,
I have a workbook that when opening it compares a cell to another workbook to make sure it is the latest version number one that is running.
The issue I have is this sheet goes saved as a new workbook which then when you open runs the same code. I need to save it as macro enabled as it has a print button.
Is it possible to disable/not run the workbook_open on a newly saved sheet?
Thanks
I have a workbook that when opening it compares a cell to another workbook to make sure it is the latest version number one that is running.
The issue I have is this sheet goes saved as a new workbook which then when you open runs the same code. I need to save it as macro enabled as it has a print button.
Is it possible to disable/not run the workbook_open on a newly saved sheet?
Thanks
VBA Code:
Sub Workbook_Open()
Dim WS As Worksheet
Sheets("QR9 Order Summary").Activate
With Application
.EnableEvents = False
.ScreenUpdating = False
.StatusBar = "Checking Version. Please wait..."
End With
Workbooks.Open "C:\Users\ad\Desktop\LC_Version.xlsx", , True
Workbooks("Consumables Mastersheet V2.6 LC.xlsm").Activate
If Workbooks("Consumables Mastersheet V2.6 LC.xlsm").Sheets("QR9 Order Summary").Range("S3").Value <> Workbooks("LC_Version.xlsx").Sheets("Version").Range("A2").Value Then
Application.StatusBar = "This is an old version of 'Consumables Mastersheet'. Please notify manager."
itype = vbAbort
ireply = MsgBox("This is an old version of 'Consumables Mastersheet'. Please notify manager!", vbCritical, "Old Version")
Application.DisplayAlerts = False
Application.Quit
Workbooks("LC_Version.xlsx").Close SaveChanges:=False
With Application
.EnableEvents = True
.StatusBar = ""
End With
Workbooks("Consumables Mastersheet V2.6 LC.xlsm").Close SaveChanges:=False
Application.Quit
Else
Application.StatusBar = "Version Match Please Continue"
Application.Wait (Now + TimeValue("0:00:02"))
End If
Workbooks("LC_Version.xlsx").Close SaveChanges:=False
Application.StatusBar = ""
End Sub