I have an excel file and name (Test 1) in the same folder path. And it has a value on ("Sheet1") in the range "C3". And I want to check this value without ever opening the workbook.
Sub Check()
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
Dim mydata As String
Dim wb As Workbook
Set wb = Workbooks.Open(ThisWorkbook.Path & "\test1.xlsx")
If wb.Worksheets("Sheet1").Range("C3").Value = "a9a" <> Empty Then
MsgBox "The value is correct", 64
Else
myError:
MsgBox "The value is incorrect", 64
End If
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True
End Sub