Try this to see if it returns anything:
Option Explicit
Dim excelApp, excelWorkbook, excelSheet, firstRow, secondRow, entireColumn, fourthRow, fifthRow, excelWorksheetFunction , rowIsEmpty4 , rowIsEmpty5
WScript.Echo "Script starts" 'TEST ECHO 1/3
' Create an instance of Excel application
Set excelApp = CreateObject("Excel.Application")
' Make Excel visible (for testing purposes)
excelApp.Visible = False ' Set to False to run in the background
' Open the Excel workbook
Dim fileName
fileName = "%Path%" ' Update the path to your Excel file
Set excelWorkbook = excelApp.Workbooks.Open(fileName)
' Specify the sheet you want to check
Set excelSheet = excelWorkbook.Sheets("Sheet1") ' Update with the index or name of your specific sheet
' Create an instance of Excel's WorksheetFunction object
Set excelWorksheetFunction = excelApp.WorksheetFunction
' Check if cell B1 is blank
If excelSheet.Range("B1").Value = "" Then
WScript.Echo "Invalid file"
' Close Excel
excelWorkbook.Close False ' Close without saving changes
' Quit Excel application
excelApp.Quit
' Clean up objects
Set excelSheet = Nothing
Set excelWorkbook = Nothing
Set excelApp = Nothing
' End script execution
WScript.Quit
End If
WScript.Echo "Script middle" 'TEST ECHO 2/3
' Check if cell B2 is blank
If excelSheet.Range("B2").Value = "" Then
WScript.Echo "Invalid file"
' Close Excel
excelWorkbook.Close False ' Close without saving changes
' Quit Excel application
excelApp.Quit
' Clean up objects
Set excelSheet = Nothing
Set excelWorkbook = Nothing
Set excelApp = Nothing
' End script execution
WScript.Quit
End If
' Check if entire column A is blank
Set entireColumn = excelSheet.Columns("A:A")
If excelWorksheetFunction.CountA(entireColumn) = 0 Then
WScript.Echo "Invalid file"
' Close Excel
excelWorkbook.Close False ' Close without saving changes
' Quit Excel application
excelApp.Quit
' Clean up objects
Set excelSheet = Nothing
Set excelWorkbook = Nothing
Set excelApp = Nothing
' End script execution
WScript.Quit
End If
' Check if the 4th row is blank
Set fourthRow = excelSheet.Rows(4)
' Check if the 5th row is blank
Set fifthRow = excelSheet.Rows(5)
' If either the 4th row or the 5th row is blank, output "Invalid file"; otherwise, output "Valid file"
' Check if the fourth row is empty
Dim cell
rowIsEmpty4 = True
rowIsEmpty5 = True
For Each cell In fourthRow.Cells
If Not IsEmpty(cell.Value) Then
rowIsEmpty4 = False
Exit For
End If
Next
' Check if the fifth row is empty
If rowIsEmpty5 Then
For Each cell In fifthRow.Cells
If Not IsEmpty(cell.Value) Then
rowIsEmpty5 = False
Exit For
End If
Next
End If
' If either the fourth or fifth row is empty, output "Invalid file"; otherwise, output "Valid file"
If rowIsEmpty4 or rowIsEmpty5 Then
WScript.Echo "Invalid file"
Else
WScript.Echo "not"
End If
' Close Excel
excelWorkbook.Close False ' Close without saving changes
' Quit Excel application
excelApp.Quit
' Clean up objects
Set excelSheet = Nothing
Set excelWorkbook = Nothing
Set excelApp = Nothing
WScript.Echo "Script ends" 'TEST ECHO 3/3
I just added 3 wscript echos to see if it returns anything when you run it.
For me it returns:

I just had a dummy file with random words in cells.
Check that you can actually open the file you are running the vbscript on. For me it returned nothing when I tried to use it on a file that I was not able to open even manually.
Also make sure that you are looking at the correct variable for output. In your screenshot it will produce %VBScriptOutput2% from your vbscript action. So just make sure you are not looking only at the default %VBScriptOutput% -action.