PDA

View Full Version : Extract specific columns from DBF to Excel



Cinema
04-29-2016, 02:33 AM
Hi,


I open DBF datas as follows: --> Data --> From Other Sources --> From Data Connection Wizard --> Others --> Microsoft OLE DB Provider for Visual FoxPro

That works perfect for small datas. But for larger one it gives the Error that the data is too large.
My ideas was to do the same thing with "record macro" (see below) and extract specific columns.

Does someone know how to extract specific columns with specific headings?


Here is the macro:



Sub Makro1()

With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( _
"OLEDB;Provider=VFPOLEDB.1;Data Source=\\Wwg00m.rootdom.net\dfs\home\Mathematics\RESULTS;Mode=Share Deny None;Extende" _
, _
"d Properties="""";User ID="""";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN=" _
, """"""), Destination:=Range("$A$1")).QueryTable
.CommandType = xlCmdTable
.CommandText = Array("`full~statics`")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceConnectionFile = _
"\\WWG00M.ROOTDOM.NET\DFS\HOME\(Standard) full~statics.odc"
.ListObject.DisplayName = "Tabelle_Standard__full_statics"
.Refresh BackgroundQuery:=False
End With

End Sub