insert data into an excel spreadsheet

Asked

Viewed 48 times

0

I need to insert data into an excel file and am using Infragistics.documents.excel for that reason.

needed to know how to see which is the last column with Indice - In the case of this image would be the URL No caso desta imagem seria o URL

also needed to insert the data into the table and they are stored in a Private Function within a data table

how to store the data for the data to be saved is as follows

Using t As New DataTable
                da.Fill(t)

                For Each Row In t.Rows
                    Dim e As New ExportLine
                    e.Url = String.Format(Url, Row!ClienteId)
                    e.Nome = Row!Nome
                    e.Telemovel = Row!Telemovel
                    lExportLines.Add(e)
                Next
            End Using

1 answer

0


I resolved with

`For Each dados In lExportLines

        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Nome

        iCol += 1I
        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Telemovel
        iCol += 1I
        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Url
        iCol = 1I
        iRow += 1I

    Next`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.