Hi,
Anyone know how to extarct data from Oracle to excel without the header using vb.net?
Below is my coding:
Dim rst As ADODB.Recordset
cn = New ADODB.Connectio n
With cn
.ConnectionStri ng = "Provider=MSDAO RA.1; " & conn.getCsatCon nection()
.CursorLocation = CursorLocationE num.adUseClient
.Open()
End With
Dim a As String
a="Select * from Backlog"
rst = cn.Execute(a)
Dim oXL As _Application
Dim oWB As _Workbook
Dim oSheet As _Worksheet()
Dim obj As Object
Dim filename As String
ReDim oSheet(3)
oSheet(0) = oWB.Worksheets( 1)
oSheet(0).Name = "Backlog Data"
obj = oSheet(0).Query Tables.Add(rst, oSheet(0).Range ("A1"))
obj.BackgroundQ uery = False
obj.Recordset = rst
obj.Refresh()
oXL.DisplayAler ts = False
filename = "C:\Backlog.xls "
oWB.SaveAs(file name)
The coding is workign fine, just that I want to exlude the header when extact to excel file.
Thanks in advance
Regards,
Steve
Anyone know how to extarct data from Oracle to excel without the header using vb.net?
Below is my coding:
Dim rst As ADODB.Recordset
cn = New ADODB.Connectio n
With cn
.ConnectionStri ng = "Provider=MSDAO RA.1; " & conn.getCsatCon nection()
.CursorLocation = CursorLocationE num.adUseClient
.Open()
End With
Dim a As String
a="Select * from Backlog"
rst = cn.Execute(a)
Dim oXL As _Application
Dim oWB As _Workbook
Dim oSheet As _Worksheet()
Dim obj As Object
Dim filename As String
ReDim oSheet(3)
oSheet(0) = oWB.Worksheets( 1)
oSheet(0).Name = "Backlog Data"
obj = oSheet(0).Query Tables.Add(rst, oSheet(0).Range ("A1"))
obj.BackgroundQ uery = False
obj.Recordset = rst
obj.Refresh()
oXL.DisplayAler ts = False
filename = "C:\Backlog.xls "
oWB.SaveAs(file name)
The coding is workign fine, just that I want to exlude the header when extact to excel file.
Thanks in advance
Regards,
Steve
Comment