Export data from Access Database to Excel
Export data from Access Database to Excel
Rate Export data from Access Database to Excel
(1(1 Vote))
Dim myEx As Object
Set myEx = CreateObject("Excel.Application")
Set myWorbook = myEx.workbooks.Add()
Set myWorkseet = myWorbook.worksheets(1)
myWorkseet.Range("A1").Select
With myWorkseet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=MS Access Database;DBQ=<databasefilenamename>;DriverId=25;FIL=MS Access;MaxBufferSize=" _
), Array("2048;PageTimeout=5;")), Destination:=myWorkseet.Range("A1"))
.CommandText = Array( _
" select * FROM `<databasefilenamename tablename>" _
)
.Name = "LCMS09292001"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = False
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
myEx.Visible = True
Set myWorkseet = Nothing
Set myWorbook = Nothing
Set myEx = Nothing
End Sub
Export data from Access Database to Excel Comments
No comments yet — be the first to post one!
Post a Comment