PROBLEMAS para EXPORTAR a EXCEL info en WIN98
Publicado por EDUARDO GASCA FIGUEROA (3 intervenciones) el 28/12/2005 21:36:07
Buenas Tardes..
tengo un problema.. puedo exportar informacion en windows XP pero en win98 es donde tengo problemas me carca errores
este es el codigo para poder exportar a excel
Dim loexcel As Excel.Application
Dim libro As Excel.Workbook
Dim hoja As Excel.Worksheet
Dim inicio As Integer
Dim i, j, indice As Integer
inicio = 0
Set loexcel = New Excel.Application
Set libro = loexcel.Workbooks.Add
Set hoja = loexcel.ActiveSheet
loexcel.Visible = True
For i = inicio To 6
If DBGrid1.Columns(i).Visible Then
indice = indice + 1
hoja.Cells(1, indice) = DBGrid1.Columns(i).Caption
For j = 0 To Data1.Recordset.RecordCount - 1
hoja.Cells(j + 2, indice) = DBGrid1.Columns(i).CellValue(DBGrid1.GetBookmark(j))
Next
End If
Next
hoja.Rows(1).Font.Bold = True
'primera fila en negritas
hoja.Columns("A:Z").AutoFit
Set loexcel = Nothing
Set libro = Nothing
Set hoja = Nothing
me podrian decir en que estoy mal????
o si tengo que agregar o correr un parche en win98
gracias por su tiempo y ayuda
tengo un problema.. puedo exportar informacion en windows XP pero en win98 es donde tengo problemas me carca errores
este es el codigo para poder exportar a excel
Dim loexcel As Excel.Application
Dim libro As Excel.Workbook
Dim hoja As Excel.Worksheet
Dim inicio As Integer
Dim i, j, indice As Integer
inicio = 0
Set loexcel = New Excel.Application
Set libro = loexcel.Workbooks.Add
Set hoja = loexcel.ActiveSheet
loexcel.Visible = True
For i = inicio To 6
If DBGrid1.Columns(i).Visible Then
indice = indice + 1
hoja.Cells(1, indice) = DBGrid1.Columns(i).Caption
For j = 0 To Data1.Recordset.RecordCount - 1
hoja.Cells(j + 2, indice) = DBGrid1.Columns(i).CellValue(DBGrid1.GetBookmark(j))
Next
End If
Next
hoja.Rows(1).Font.Bold = True
'primera fila en negritas
hoja.Columns("A:Z").AutoFit
Set loexcel = Nothing
Set libro = Nothing
Set hoja = Nothing
me podrian decir en que estoy mal????
o si tengo que agregar o correr un parche en win98
gracias por su tiempo y ayuda
Valora esta pregunta


0