That didn't work. Here is my code, any ideas:
Sub Aut
pen()
Dim OraSession As Object
Dim OraDatabase As Object
Dim QuoDynaSet As Object
Dim flds() As Object
Dim fldcount As Integer
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("LIVE1", "*****/*****", 0&)
Set QuoDynaSet = OraDatabase.CreateDynaSet("select CU_NAME from CU", 0&)
Range (AK1)
Selection.ClearContents
'Declare and create an object for each column.
'This will reduce object reference and speed
'up your application.
fldcount = QuoDynaSet.Fields.Count
ReDim flds(0 To fldcount - 1)
For Colnum = 0 To fldcount - 1
Set flds(Colnum) = QuoDynaSet.Fields.Count - 1
Next
'Insert Column Headings
For Rownum = 2 To QuoDynaSet.Fields.Count - 1
ActiveSheet.Cells(1, Colnum + 1) = flds(Colnum).Name
Next
'Display Data
For Rownum = 2 To QuoDynaSet.RecordCount + 1
For Colnum = 0 To fldcount - 1
ActiveSheet.Cells(Rownum, Colnum + 1) = flds(Colnum).Value
Next
QuoDynaSet.MoveNext
Next
Range(AK1).Select
End Sub