//First ... ADD Reference Microsoft Excel Library
Dim xl As Excel.Application
Dim fldCount As Integer
Dim recCount As Long
Dim iCol As Integer
Dim iRow As Integer
Set xl = New Excel.Application
With xl
.Workbooks.Add
.Worksheets(1).Name = "Export Daily"
' Copy field names to the first row of the worksheet
fldCount = Adodc1.Recordset.Fields.Count
For iCol = 1 To fldCount
xl.Cells(1, iCol).Value = Adodc1.Recordset.Fields(iCol - 1).Name
Next
Call .ActiveSheet.Range("A2").CopyFromRecordset(Adodc1.Recordset)
.Visible = True
End With
Dim xl As Excel.Application
Dim fldCount As Integer
Dim recCount As Long
Dim iCol As Integer
Dim iRow As Integer
Set xl = New Excel.Application
With xl
.Workbooks.Add
.Worksheets(1).Name = "Export Daily"
' Copy field names to the first row of the worksheet
fldCount = Adodc1.Recordset.Fields.Count
For iCol = 1 To fldCount
xl.Cells(1, iCol).Value = Adodc1.Recordset.Fields(iCol - 1).Name
Next
Call .ActiveSheet.Range("A2").CopyFromRecordset(Adodc1.Recordset)
.Visible = True
End With
3 comments:
Thanks it works get che!!!!pak ganern
Great work. Thank you.
Library microsoft excel? or any another?
Post a Comment