I have 2 Modules and trying to call each of then from a Module1. office 2016, it don't run the 2nd call (OpenNECopper) but execute the 1st call (OpenNEFiber)
Need to run both the calls from (OneonOne) , now its just running the 1st one and stops and don't run the 2nd call, is there a way to run both one after the other.
this is one module which I am calling other 2 modules.
This is 1st one call
this is 2nd one call
Need to run both the calls from (OneonOne) , now its just running the 1st one and stops and don't run the 2nd call, is there a way to run both one after the other.
this is one module which I am calling other 2 modules.
VBA Code:
Sub OneonOne()
Call OpenNEFiber
Application.Wait (Now() + TimeValue("00:00:05"))
Call OpenNECopper
Application.Wait (Now() + TimeValue("00:00:05"))
MsgBox "Both calls are Complete", vbInformation, "Call 1 & 2"
End Sub
This is 1st one call
VBA Code:
Sub OpenNEFiber()
Dim FilePath As String
Dim FileName As String
Dim wb As Workbook
FilePath = ActiveWorkbook.Path
FileName = "Golden Automation NE Fiber V1.xlsm" ' Replace with your file name
FilePath = FilePath & "\" & FileName
If Dir(FilePath) <> "" Then
Set wb = Workbooks.Open(FilePath)
Application.Wait (Now() + TimeValue("00:00:05"))
Application.Run "'" & wb.Name & "'!FIberNEALL"
wb.Close SaveChanges:=True
Else
MsgBox "File not found: " & FilePath
End If
End Sub
this is 2nd one call
VBA Code:
Sub OpenNECopper()
Dim FilePath As String
Dim FileName As String
Dim wb As Workbook
FilePath = ActiveWorkbook.Path
FileName = "Golden Automation NE Copper V1.xlsm" ' Replace with your file name
FilePath = FilePath & "\" & FileName
If Dir(FilePath) <> "" Then
Set wb = Workbooks.Open(FilePath)
Application.Wait (Now() + TimeValue("00:00:05"))
Application.Run "'" & wb.Name & "'!callNECopperALL"
wb.Close SaveChanges:=True
Else
MsgBox "File not found: " & FilePath
End If
End Sub