Dim oExcel As Object
Dim oBook As Object
Dim I, J As Integer
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add()
oExcel.Visible = True
For I = 1 To DataGrid1.Columns.Count
oBook.Worksheets(1).Cells(1, I) = DataGrid1.Columns(I - 1).Caption
For J = 0 To DataGrid1.VisibleRows - 1
oBook.Worksheets(1).Cells(J + 2, I) = DataGrid1.Columns(I - 1).CellText(DataGrid1.RowBookmark(J))
Next J
Next I