I needed a macro that gathers data from a hundred different workbooks into a single sheet. This is what I came up with. Sadly, Excel crashes when I try to run it and no error message is shown.

```
Sub Cop()

Dim lin As Integer
Dim myfolder As String 
Dim myfile As String 
Dim proj As String 
Dim master As Workbook 
Dim controle As Worksheet 
Dim fonte As Worksheet

Set master = ThisWorkbook 
Set controle = master.Worksheets("Controle Meta 2024 - Plus")

lin = 5

myfolder = "R:\2. XYZ\Empresas\ABC\1. Mandato\1. Informações\1. Informações Recebidas\Projeções Lançamentos 2020-2024\DE-PARA"

For i = 1 To 118
    proj = master.Worksheets("Controle Meta 2024 - Plus").Cells(lin, 2)
    myfile = Dir(myfolder & proj & "\*.xlsx")
    On Error GoTo Erro
    Workbooks.Open Filename:=myfile
    Set fonte = Workbooks(myfile).Worksheets("DADOS")
    master.controle.Cells(lin, 70) = Workbooks(myfile).fonte.Range("E7")
    master.controle.Cells(lin, 71) = Workbooks(myfile).fonte.Range("E6")
    Workbooks(myfile).Close SaveChanges:=False
    lin = lin + 1 

Prox:
    Next i 

Erro:
    Resume Prox

End Sub

```

Thanks!