Tema: holas!
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/06/2008, 17:11
kikin_pc
 
Fecha de Ingreso: mayo-2008
Mensajes: 7
Antigüedad: 16 años
Puntos: 0
Respuesta: holas!

Hola berek es muy sencillo solo tines que agregar la referencia de exel que se llama Microsoft exel luego llamas a la funcion de la Api bueno te coloco un ejemplo

Dim xlBook As Excel.Workbook
Dim xlsRango As Excel.Range
Dim xlsName As Excel.Name
Dim Libro As String


Libro = "c:\FORMATO_SECCIONES.xls"
'referencia para exel
Set xlApp = New Excel.Application
'Abre la Aplicacion
If (xlApp Is Nothing) Then Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(FileName:=Libro, ReadOnly:=False)
'Selecciona la hoja
Set xlsHoja = xlBook.Worksheets.Item("Hoja1")
'Calculando el Tamño de la MAtriz

Dim Pos() As Integer
Dim Ceros() As Integer
Dim AuxTramos As Integer

For cnt = Ini_Rango To Fin_RAngo
If xlsHoja.Cells(cnt, 4).Text = "0" Then
AuxTramos = AuxTramos + 1
Else
End If
Next cnt
'Pausando tramos
ReDim Ceros(AuxTramos)
ReDim Pos(AuxTramos)
Dim AuxPos As Integer
'anexando valor del Pos de la matriz
For cnt = Ini_Rango To Fin_RAngo
If xlsHoja.Cells(cnt, 4).Text = "0" Then
Pos(AuxPos) = cnt
AuxPos = AuxPos + 1
Else
End If
Next cnt

Dim PasoPos As Integer
Dim Datos() As String

For PasoPos = 0 To UBound(Pos)
For CntOk = Pos(PasoPos) To Fin_RAngo
Next CntOk
Next PasoPos


xlApp.Visible = True

suerte amiga tengo flojera de explicar jejeje