I'm mainly trying to work off of the solution in this thread How to loop through all sheets in all workbooks within a folder.
This is the code responsible for filling the array
'Fill the array(myFiles)with the list of Excel files in the folder
Fnum = 0
Do While FilesInPath <> ""
Fnum = Fnum + 1
ReDim Preserve MyFiles(1 To Fnum)
MyFiles(Fnum) = FilesInPath
FilesInPath = Dir()
Loop
If I understand it correctly, it should loop through all files in a given folder and retrieve every excel file in it.
Based on this thread ExecuteExcel4Macro to get value from closed workbook ExecuteExcel4Macro(string) should allow to check/retrieve the content of a given cell in a closed workbook of which I already have its name and its sheet's name.
I want to check the value of a cell (so I can identify whether the file is based on a template which I would like to work on) so it gets added to the array in the first.
I would like to integrate the solution to check cell content into the loop I pasted above.
Option Explicit
Sub Sample()
Dim wbPath As String, wbName As String
Dim wsName As String, cellRef As String
Dim Ret As String
'wbPath = "C:\Documents and Settings\Siddharth Rout\Desktop\"
wbPath = "C:\Users\my.name\Desktop\"
wbName = "QOS DGL stuff.xls"
wsName = "ACL"
cellRef = "C3"
Ret = "'" & wbPath & "[" & wbName & "]" & _
wsName & "'!" & Range(cellRef).Address(True, True, -4150)
MsgBox ExecuteExcel4Macro(Ret)
End Sub