Exportar Un Flexgrid A Excel2
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38. 39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
Exportar un Flexgrid a Excel
Option Explicit
'
' \\ Autor : Luciano Lodola http://www.recursosvisualbasic.com.ar/
' \ Agregar la Referencia a Microsoft Excel Object Library '
'
' \\ Botón para importar datos desde el Grid hacia la hoja en un libro exisitente
'
Private Sub Command1_Click() If Exportar_Excel("c:\Nuevo Microsoft Excel Worksheet.xls", MSHFlexGrid1) Then
MsgBox " Datos exportados ", vbInformation
End If
End Sub
'
' \\ Inicio
'
Private Sub Form_Load()
' cargar grid con valores With MSHFlexGrid1
.AllowUserResizing = flexResizeColumns
.FixedCols = 0
.Rows = 2
' Setear Encabezados y añadir filas .FormatString = "Nombre de Producto|Precio del producto"
.AddItem "Producto 1" & vbTab & FormatCurrency("14,31", 2)
.AddItem "Producto 1" & vbTab & FormatCurrency("17,32", 2) .AddItem "Producto 1" & vbTab & FormatCurrency("11,36", 2)
.AddItem "Producto 1" & vbTab & FormatCurrency("16,34", 2) ...
Regístrate para leer el documento completo.