I am having some trouble with this code and know it's most probably an easy little syntax I am missing. the 'FileNameR' is text in a cell of the full workbook name including the file extension. I have also tried declaring it as a string (besides the variant). The error is coming on 'InaWB' with a runtime error 13 Type mismatch. - guessing why its a simple syntax thing I am missing.
Code:
Dim FileNameR As Variant
FileNameR = ThisWorkbook.Sheets("Sheet1").Range("O4", ThisWorkbook.Sheets("Sheet1").Range("O4").End(xlDown)).Value
Dim InaWB As Workbook
Set InaWB = Workbooks(FileNameR)