I am trying to export Access data as Excel using ADO. I have tried the following two methods below. I would like the data formatting to be kept for a field in my Access database that is a field type of Hyperllink.
The top method is coming out as a text field and the bottom method comes out as a general format.
Any ideas?
Thanks.
Swi
The top method is coming out as a text field and the bottom method comes out as a general format.
Any ideas?
Thanks.
Code:
conn.Execute "SELECT * INTO [Excel 8.0;Database=" & _
ExcelFileName & "].[Sheet1] FROM MASTER WHERE [Status] = 0", NumOfRecExp
Code:
Set rs = conn.Execute("Master", , adCmdTable)
'Create a new workbook in Excel
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
Set oSheet = oBook.Worksheets(1)
'Transfer the data to Excel
oSheet.Range("A1").CopyFromRecordset rs
'Save the Workbook and Quit Excel
oBook.SaveAs ExcelFileName
oExcel.Quit
'Close the connection
rs.Close
Swi