microsoft excel 2010 - Getting Application-Defined or Object defined error

07
2014-07
  • Pamela

    I'm working with multiple sheets in my macro, for this particular code I'm just using 2 sheets. One to get the information, and the other to print the data.

    Here's the part of my code with the problem:

    Sheets("Layout").Select
    
    For q = 1 To Z
        For i = 5 To 15
            For j = 5 To 785
                If Cells(j, i) = Salidas(q) Then
                Despejes(q, 1) = j
                Despejes(q, 2) = i
                    x = j
                    y = i
                    u = i
                    k = j
                    aux = 0
                    suma = 0
                    'Enocntrar el Tier1
                    Do While Cells(k, u) <> u - 4
                        k = k + 1
                    Loop
                    Do While Cells(k - 1, u + 1) <> ""
                            aux = aux + 1
                           u = u + 1
                    Loop
    
    
                    For b = y + 2 To y + aux
                    p = k - 1
                        For a = 1 To 5
                           If Cells(p, b) <> "" Then
                                suma = suma + 1
                            End If
                            p = p - 1
                        Next
                    Next
    
                    For a = k - 5 To x
                        If Cells(a, y + 1) <> "" Then
                            suma = suma + 1
                        End If
                    Next
    
                    For t = k - 5 To x - 1
                        If Cells(t, y) <> "" Then
                            suma = suma + 1
                        End If
                    Next
    
                    g = x
                    Do While Cells(g, y) <> ""
                        Cells(g, y) = Cells(g - 1, y)
                        g = g - 1
                    Loop
    
            End If
            Despejes(q, 3) = suma
            Next
        Next
    Next
    

    In the first Do while is where the error is showing and I have no idea why.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    visual basic - I am getting error in VB6.0
  • Questioner

    I'm getting a runtime error as 20728-f.

    I got the solution to register cpre23.dll and dwmapi.dll. However I can't find the cpre23.dll file.

    Where can I find this DLL file, or how else can I rectify this problem?


  • Related Answers
  • Dani

    The DLLs you referenced are from the Crystal Report Engine Library. This library isn't freely distributable so you shouldn't find it available for download. If you're not a licensed user you should become one.