I am trying to perform a process for 2 files I am naming specifically. Since there are 2 files, I am declaring parts of the folder names and file names as an array. But I think the mixing of arrays and strings are giving me the Type Mismatch error message. Or my construction below is just completely wrong for looping through multiple files? How should I correct the below? Thanks in advance!
VBA Code:
Sub Mgmtaccts()
Dim FullName As Object
Dim FileNames As Object
CurrentFolderYear = Sheet1.Range("B4").Value
CurrentFolderMonth = Sheet1.Range("B5").Value
CurrentFileMonth = Sheet1.Range("B6").Value
Dim EntityName As String, FolderName As String, MgmtAcctsName As String, PathName As String
EntityName = Array("ABC LP", "ABC (GP)")
FolderName = Array("Folder ABC LP", "Folder ABC (GP)")
PathName = "\\Server\Monthly " & CurrentFolderYear & "\" & CurrentFolderMonth & "\Other\" & FolderName
MgmtAcctsName = EntityName & " Management Accounts " & CurrentFileMonth
FullName = PathName & "\" & MgmtAcctsName & ".xlsx"
For Each FullName In FileNames
Workbooks.Open FileName:=FullName
Insert code here
Next FullName
End Sub