Hi,
To write data from screen and put to an excel file you have to use the getstring command, open a file for output (CSV file) and write this file with the information.
This is an example:
Msg$ = "Welcome to Data entry Macro for big supplier reading an text file, Please enter the drive where you want to open the excel file booking.csv"
Drive$ = UCase$(Left$(InputBox$(Msg$), 1)) ' Get user input.
' This section open the input and the output file
If Drive$ = "C" or Drive$ = "A" Then
FileOut$ = Drive$ + ":\approval.csv"
If Dir$(FileName$) <> "" Then ' Check if file exists.
Open FileOut$ For Output As #2 ' It open an output file for write
Else ' No prueba.txt.
Msg$ = "Could not find a prueba.txt file on drive "
Msg$ = Msg$ + UCase$(Drive$) + ":"
End If
Else
Msg$ = "You did not provide a valid file "
Msg$ = Msg$ + "check in unit A: or C: drive."
End If
Do
For FacturasPorPagina= 0 to 6 step 1
TablaProvision(TotalFacturas,0)=MyScreen.Getstring(FacturasPorPagina*2 + 10, 02, 02)
TablaProvision(TotalFacturas,1)=MyScreen.Getstring(FacturasPorPagina*2 + 10, 05, 06)
TablaProvision(TotalFacturas,2)=MyScreen.Getstring(FacturasPorPagina*2 + 10, 48, 15)
If Instr(TablaProvision(TotalFacturas,2),","

Then
poscomma = Instr(TablaProvision(TotalFacturas,2),","

Mid(TablaProvision(TotalFacturas,2), poscomma) = "."
end if
TablaProvision(TotalFacturas,3)=MyScreen.Getstring(FacturasPorPagina*2 + 10, 66, 03)
TablaProvision(TotalFacturas,4)=MyScreen.Getstring(FacturasPorPagina*2 + 10, 17, 20)
TablaProvision(TotalFacturas,5)=MyScreen.Getstring(FacturasPorPagina*2 + 11, 10, 25)
TablaProvision(TotalFacturas,6)=MyScreen.Getstring(FacturasPorPagina*2 + 11, 51, 8)
If TablaProvision(TotalFacturas,0) = " " Then
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
exit do
End if
TotalFacturas = TotalFacturas + 1
If FacturasPorPagina=5 Then
Sess0.Screen.Sendkeys("<pf2>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
FacturasPorPagina= 0
End if
Next FacturasPorPagina
loop
For ImprimirTabla = 0 to TotalFacturas Step 1
For Variables = 0 to 6 Step 1
Print #2, TablaProvision(ImprimirTabla,Variables)& ",";
Next Variables
Print #2,
Next ImprimirTabla