Patrícia Villela
Patrícia Villela

Reputation: 839

Object does not accept method

I'm experiencing a problem with my VBA application.
I need to define a Recordset and enter the result of a certain field, line by line, into an Excel Worksheet. The problem is, when I do this

With appXLS.Worksheets("Resultado Geral")
    For intPosition = LBound(Arr) To (UBound(Arr) - 1)
        teste = Arr(intPosition, 0) & "_Status"
        .Cells(i, 6) = MyRecBase.Fields(teste)
    Next
End With

It displays the problem (Error '438') and marks the ".Cells" line. But the biggest problem is that I use the same method a few lines before.

Please, help me. I would appreciate.

Thanks in advance

Upvotes: 1

Views: 74

Answers (1)

i_saw_drones
i_saw_drones

Reputation: 3506

Check the line in your code:

.Cells(i, 6) = MyRecBase.Fields(teste)

since it is not evident what i is and how it is calculated based on your loop.

Upvotes: 2

Related Questions