I'm searching for a string within a column of a closed Excel workbook.
The following code gives a type mismatch error on MsgBox.
If I replace that line with ret = "'" & wbPath & "[" & wbName & "]" & wsName & "'!" & Range("C3015").Address(True, True, -4150) then the macro gives me a hard-coded value (in this case, the value at cell C3015).
How can I search for other values within columns of closed workbooks, without opening them?
Dim wbName As String, wbPath As String, wsName As String
wbPath = "Path\To\Workbook\"
wbName = "NameOfWorkbook.xlsb"
wsName = "NameOfWorkSheet"
Dim ret As String
ret = "'" & wbPath & "[" & wbName & "]" & wsName & "'!" & Range("D:D").Find(What:="SearchColumnDForThisString")
MsgBox ExecuteExcel4Macro(ret) // <--------- TYPE MISMATCH ERROR
Find()directly? - Tim Williams