Help me
if i open excel file with 2.000 rows i have no problem
B4X:
Sub Leggi_excel(Dir As String ,File_excel As String)
Start=DateTime.Now
Leggi.InitializeExistingAsync("Lettura",Dir,File_excel,"")
End Sub
B4X:
Sub Lettura_ready(Success As Boolean)
LogDebug("Lettura Finita")
Dim Tempo_di_lettura As Double=DateTime.Now-Start
Tempo_di_lettura=Tempo_di_lettura/1000
LogDebug ("Tempo di lettura " & Tempo_di_lettura & " Secondi")
'Legge il file selezionato e scrive Variabile Elenco (20)
Elenca
'Scrive il TreeView
Costruisci_tree.Riempi_Tree(Main.TreeWiew_01,Caratteristiche_excell)
end sub
but if I open larger files about 100.000 lines nothing happens
What can I do ?
Sub Leggi_excel(Dir As String ,File_excel As String)
Start=DateTime.Now
'Leggi.InitializeExistingAsync("Lettura",Dir,File_excel,"")
Leggi.InitializeExisting(Dir,File_excel,"")
End Sub
The result is
java.lang.OutOfMemoryError: Java heap space ........
Sub AbrirArchivos()
'Paso 1: Declarar las variables
Dim Archivos As String
'Paso 2: Especificar una carpeta y el tipo de archivo que buscamos
'en este caso la carpeta se llama "temporal" y el tipo de dato es "xlsx"
Archivos = Dir("C:\temporal\*.xlsx")
Do While Archivos <> “”
'Paso 3: Abrir los libros uno por uno
Workbooks.Open "C:\temporal\" & Archivos
' Paso 4: se coloca el código que se quiere correr
'en el caso de este ejemplo se corre el código que aparece a continuación
'el cual sirve para borrar el contenido de la celda A1
[B]Range("a1").ClearContents ' not this of course[/B]
'Paso 5: Cuadro de mensaje, cerrar y guardar cambios
MsgBox ActiveWorkbook.Name
ActiveWorkbook.Close SaveChanges:=True
'Paso 6: buscar más archivos en la carpeta para volver seguir la secuencia
Archivos = Dir
Loop
End Sub
export in Excel to csv.... then use this with b4x...
something like that:
Code:
Sub BuildDatevFile(ExFile As String)
Open ExFile For Output As #1
'Kopfdaten
Print #1, sDatevKopf
'Buchungsdaten
For x = 1 To tabDatev.UsedRange.EntireRow.Count
For y = 1 To 116
P tabDatev.Cells(x, y)
Next y
Print #1, ""
Next x
Close #1
End Sub
Sub P(Datenfeld As String)
If Datenfeld = "" Then
Print #1, Chr(34) & Chr(34) & Chr(59);
Else
Print #1, Datenfeld & Chr(59);
End If
End Sub