Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/04/2010, 03:19
Avatar de Sergio18
Sergio18
 
Fecha de Ingreso: abril-2010
Ubicación: No quieras saberlo
Mensajes: 94
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Importar .txt

edito: Aqui dejo el exportar

Cita:
Private Sub Command5_Click()
Dim i As Boolean

i = Exportar_FlexGrid_txt(MSFlexGrid1, "practicas.txt", vbTab)
If i Then
MsgBox "Msflexgrid exportado a txt", vbInformation
End If
End Sub


Public Function Exportar_FlexGrid_txt(FlexGrid As Object, _
Path_Txt As String, _
Delimitador As Variant) As Boolean
Dim Fila As Integer
Dim Columna As Integer
Dim Free_File As Integer

Free_File = FreeFile

Open Path_Txt For Output As #Free_File

For Fila = 0 To _
FlexGrid.Rows - 1
FlexGrid.Row = Fila
For Columna = 0 To _
FlexGrid.Cols - 1
FlexGrid.Col = Columna

If Columna > 0 Then
Print #Free_File, Delimitador;
End If

Print #Free_File, vbNullString & FlexGrid.Text & vbNullString;
Next

Print #Free_File, ""

Next
Close
Exportar_FlexGrid_txt = True
Exit Function
Err_Funcion:
Close #Free_File
MsgBox Err.Description, vbCritical
End Function