I'm attempting to open all of the workbooks in this range and run their macros. The idea is to open the first workbook, run the macro, and then close it before moving on to the next. The name of the macro is the same across all workbooks. I'm running the code and I'm getting (subscript out of range) error. Any help would be much appreciated.
Sub files_export()
Dim wb As Workbook
Set wb = ThisWorkbook
Dim startsheet As Worksheet
Set startsheet = wb.Worksheets("Start")
Dim linkrange As Range
Set linkrange = startsheet.Range("C4:C21")
Dim y As String
Dim c As Range
For Each c In linkrange
If c.Value <> "" Then
y = c.Value
Workbooks.Open (y)
Workbooks(y).Application.Run ("macro1")
Workbooks.close (y)
End If
Next c
End Sub