Android Question Excel File Corrupted

Richard Phipps

Member
Licensed User
I used this code to create an xls file but it creates a corrupted file which Excel cannot easily open. However, i overrode the warnings and "opened anyway" to see a blank workbook.

Also the sheet is not called "BloodFlight" but the same as the file name.

Also, the cell is not created with the text. It opens as Read-Only.

What do i need to correct please ?

Write Excel Cell:
Sub CreateANDWriteXL(FLname As String, Xpos As Int, Ypos As Int)
  
    Dim newWorkbook As WritableWorkbook
    newWorkbook.Initialize(File.DirInternal, FLname)
  
    Dim sheet1 As WritableSheet
    sheet1 = newWorkbook.AddSheet("BloodFlight",0)
  
  
    Dim cell As WritableCell
  
    'A0
    cell.InitializeText(0, 0, "Hello")
    sheet1.AddCell(cell)
  
  
Amended to this.

In fact after playing with the code, just the first two lines of code, creating the workbook, creates and unreadable xls file








End Sub
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…