Necesito saber como puedo pasar los registros de un MSFlexGrid a Excel, si alguien me pudi
Necesito saber como puedo pasar los registros de un MSFlexGrid a Excel, si alguien me pudiera ayudar se lo agradeceria mucho.
Espero y te sirva hermano
Private Sub cmdEnviar_Click()
Dim xla As New Excel.Application
Dim xlb As New Excel.Workbook
Dim xls As New Excel.Worksheet
Dim xlr As Excel.Range
‘mfgconsulta es el mshflexgrid
Set xlb = xla.Workbooks.Add 'asignar el libro
Set xls = xlb.Worksheets.Add 'asignar la hoja
xls.Activate
Dim cufilas As Integer
Dim fila As Integer
Dim colum As Integer
Dim x As Integer
fila = 1
colum = 0
cufilas = mfgconsulta.Rows
For x = 0 To cufilas - 1
For colum = 0 To mfgconsulta.Cols - 1
xls.Cells(fila, colum + 1) = mfgconsulta.TextMatrix(x, colum)
Next colum
fila = fila + 1
Next x
xla.Application.Visible = True
xla.Windows(1).Visible = True
End Sub
Private Sub cmdEnviar_Click()
Dim xla As New Excel.Application
Dim xlb As New Excel.Workbook
Dim xls As New Excel.Worksheet
Dim xlr As Excel.Range
‘mfgconsulta es el mshflexgrid
Set xlb = xla.Workbooks.Add 'asignar el libro
Set xls = xlb.Worksheets.Add 'asignar la hoja
xls.Activate
Dim cufilas As Integer
Dim fila As Integer
Dim colum As Integer
Dim x As Integer
fila = 1
colum = 0
cufilas = mfgconsulta.Rows
For x = 0 To cufilas - 1
For colum = 0 To mfgconsulta.Cols - 1
xls.Cells(fila, colum + 1) = mfgconsulta.TextMatrix(x, colum)
Next colum
fila = fila + 1
Next x
xla.Application.Visible = True
xla.Windows(1).Visible = True
End Sub
