SoloCodigo

CLR: .Net / Mono / Boo / Otros CLR => VB .NET => Mensaje iniciado por: mexicano2013 en Viernes 22 de Marzo de 2013, 23:09

Título: ME MANDA ERROR EN FIND XLlookat
Publicado por: mexicano2013 en Viernes 22 de Marzo de 2013, 23:09
 :think:
Título: Re:ME MANDA ERROR EN FIND XLlookat
Publicado por: mexicano2013 en Viernes 22 de Marzo de 2013, 23:12
quiero buscar un texto en un rango en excel, pero me manda error, alguien me puede ayudar por fa, estoy trabajando en en vb.net 2013 y excel
Imports Microsoft.Office.Interop.Excel

Public Class Nivelacion


Dim excel As New Microsoft.Office.Interop.Excel.Application


Private Sub DemoFind()
    Dim currentFind As Excel.Range = Nothing
    Dim firstFind As Excel.Range = Nothing

    ' You should specify all these parameters every time you call this method,
    ' since they can be overridden in the user interface.
    currentFind = Me.Fruits.Find("apples", , _
        Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, _
        Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, False)

    While Not currentFind Is Nothing

        ' Keep track of the first range you find.
        If firstFind Is Nothing Then
            firstFind = currentFind

        ' If you didn't move to a new range, you are done.
        ElseIf currentFind.Address = firstFind.Address Then
            Exit While
        End If

        With currentFind.Font
            .Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
            .Bold = True
        End With

        currentFind = Me.Fruits.FindNext(currentFind)
    End While
End Sub

End Class

Título: Re:ME MANDA ERROR EN FIND XLlookat
Publicado por: mexicano2013 en Sábado 23 de Marzo de 2013, 00:26
ya agregue com pero me dice que no he declarado XLlookat
Auxilio.