Android Question Write to Exist Sheet on Excel workbook

hibrid0

Active Member
Licensed User
Hi, I have a excel book and I can read, that's very easy.
Now I try to write some cells.

I follow the tutorial and samples here.
With this code I can create a new Workbook from the original workbook.

B4X:
libro2.Initialize2(ruta_completa, "WORK.xls", libro1)


        respuestas_hoja=libro2.AddSheet("0-Preguntas", 0)

        celda.InitializeText(2, 2, "Hola Excel")
        respuestas_hoja.AddCell(celda)
But this code create a new Sheet and write the cell, but with only that cell, no have the other sheet info, and I dont need create a sheet, in theory is copied from the original.
 

hibrid0

Active Member
Licensed User
Problem solved

I see the WritetableBook GetSheet.

B4X:
libro2.Initialize2(ruta_completa, "WORK.xls", libro1)

       
        respuestas_hoja=libro2.GetSheet(0)

        celda.InitializeText(2, 2, "Hola Excel")
        respuestas_hoja.AddCell(celda)
Very easy, sorry.
 
Top