I have two excel files that run macros upon opening. I have an additional "dummy" excel file with the following codes:
Private Sub Workbook_Open()
If InStr(1, ThisWorkbook.Name, "NoRun") > 0 Then
Range("C6").Select
'Do nothing so the macro won't run.
Else
Application.OnTime Now + TimeValue("00:00:05"), "PortsmouthChem"
Application.OnTime Now + TimeValue("00:01:00"), "GloucesterChem"
End If
End Sub
Sub GloucesterChem()
Workbooks.Open Filename:="C:\Users\nphifer\Desktop\Chemistry Reports to GE\DCS-11422-WHEELABRATORGLOUCESTER.xlsm"
End Sub
Sub PortsmouthChem()
Workbooks.Open Filename:="C:\Users\nphifer\Desktop\Chemistry Reports to GE\DCS-11228-WHEELABRATORPORTSMOUTH.xlsm"
End Sub
When I open up the "dummy" file, it will run "PortsmouthChem" but it won't go through it's macros, but instead wait until "GloucesterChem" is executed and it will just run the macros within that. I need a way to have both of them open and run their macros and am kind of stumped. I feel like it should be an easy solution but am having some trouble. Any help is much appreciated.
Private Sub Workbook_Open()
If InStr(1, ThisWorkbook.Name, "NoRun") > 0 Then
Range("C6").Select
'Do nothing so the macro won't run.
Else
Application.OnTime Now + TimeValue("00:00:05"), "PortsmouthChem"
Application.OnTime Now + TimeValue("00:01:00"), "GloucesterChem"
End If
End Sub
Sub GloucesterChem()
Workbooks.Open Filename:="C:\Users\nphifer\Desktop\Chemistry Reports to GE\DCS-11422-WHEELABRATORGLOUCESTER.xlsm"
End Sub
Sub PortsmouthChem()
Workbooks.Open Filename:="C:\Users\nphifer\Desktop\Chemistry Reports to GE\DCS-11228-WHEELABRATORPORTSMOUTH.xlsm"
End Sub
When I open up the "dummy" file, it will run "PortsmouthChem" but it won't go through it's macros, but instead wait until "GloucesterChem" is executed and it will just run the macros within that. I need a way to have both of them open and run their macros and am kind of stumped. I feel like it should be an easy solution but am having some trouble. Any help is much appreciated.