Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
Private Sub Command1_Click()
Dim oServiceManager As Object
Dim oDesktop As Object
Dim oDoc As Object
Dim oSheet As Object
Dim Columna As Object
Dim ColumnaCal As Integer
Dim aNoArgs()
Set oServiceManager = CreateObject("com.sun.star.ServiceManager")
Set oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop")
Set oDoc = oDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, aNoArgs())
Set oSheet = oDoc.getSheets().getByIndex(0)
X = 1 'Para dejar espacio en la primera fila
ColumnaCal = 0
For c = 1 To ListSearch.ColumnHeaders.Count
oSheet.getCellByPosition(ColumnaCal, 0).SetString ListSearch.ColumnHeaders(c)
ColumnaCal = ColumnaCal + 1
Next
For i = 1 To ListSearch.ListItems.Count Step 1
For ss = 1 To 12 'Cantidad de Columnas
oSheet.getCellByPosition(0, X).SetValue (ListSearch.ListItems(i))
oSheet.getCellByPosition(ss + 0, X).SetString (ListSearch.ListItems(i).SubItems(ss))
Next ss
X = X + 1
Next i
End Sub
Private Sub Exportar()
Dim objExcel As Excel.Application
Dim Ancho As Integer
Dim Dato As Variant
Dim c As Integer
Dim f As Integer
Dim ColumnaExcel As Integer
Set objExcel = New Excel.Application
With objExcel
.Visible = False
.SheetsInNewWorkbook = 1 'Determina el numero de hojas que se mostrara en el Excel
.Workbooks.Add 'Crea el Libro
.Sheets("Hoja1").Name = "Registre"
'Recorrer las celdas del Listview
'----------------------------------------------
' Bucle principal
'---------------------------------------------
For f = 0 To ListSearch.ListItems.Count
ColumnaExcel = 1
For c = 1 To ListSearch.ColumnHeaders.Count
If f = 0 Then ' Títulos
.Cells(1, ColumnaExcel) = ListSearch.ColumnHeaders(c).Text
Else
If c = 1 Then
.Cells(f + 1, 1) = ListSearch.ListItems(f).Text
Else
Dato = ListSearch.ListItems(f).SubItems(c - 1)
' Prevención para que las fechas pasen a Excel como tales
' En mi listview los títulos de las columnas fecha empiezan con F.
If Left(ListSearch.ColumnHeaders(c).Text, 2) = "F." And Dato <> "" Then Dato = CDate(Dato)
.Cells(f + 1, ColumnaExcel) = Dato
End If
.Cells(f + 1, ColumnaExcel + 1).Select
ColumnaExcel = ColumnaExcel + 1
End If
Next
Next
'----------------------------------------------
' Fin del Bucle principal
'---------------------------------------------
.Range("A1").Select
.Range(.Selection, .Selection.End(xlToRight)).Select
PonerSombraCelda objExcel, 15, xlSolid
PonerBordeCelda objExcel
.Range(.Selection, .Selection.End(xlDown)).Select
PonerBordeCelda objExcel
.Cells.Select
.Selection.WrapText = False
.Cells.EntireColumn.AutoFit
.Range("A1").Select
End With
'Preparar impresión en apasiado y a una hoja de ancho
With objExcel.ActiveSheet.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
'fraRegistros.Visible = False
objExcel.Visible = True
Set objExcel = Nothing
Screen.MousePointer = vbDefault
End Sub
Private Sub PonerBordeCelda(Objeto As Excel.Application)
With Objeto
.Selection.Borders(xlEdgeLeft).Weight = xlThick
.Selection.Borders(xlEdgeTop).Weight = xlThick
.Selection.Borders(xlEdgeBottom).Weight = xlThick
.Selection.Borders(xlEdgeRight).Weight = xlThick
.Selection.Borders(xlInsideVertical).Weight = xlThin
.Selection.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub
Private Sub PonerSombraCelda(Objeto As Excel.Application, ColorIndex As _
Integer, Pattern As Integer)
With Objeto.Selection.Interior
.ColorIndex = ColorIndex
.Pattern = Pattern
End With
End Sub
Private Sub Command1_Click()
Dim Cadena As String
Cadena = Text1.Text
' Aca invertimos el texto
Cadena = StrReverse(Text1.Text)
Text2.Text = Cadena
End Sub
Private Sub reload()
Set rst = New ADODB.Recordset
rst.Open sql, CN
Set grilla.Recordset = rst '<----------Te falto la T
grilla.Refresh
End Sub
Private Sub Form_Load()
Call Conectar '<--------- Te Falto esa
sql = "select * from socios order by id"
Call reload
End Sub