Not All Data Being Imported

G

Gazz_85

I have written some code to import a data table from another document, but
not all the information is being pulled across:

the code is below:

Sub PODT_Report_Import()
'
' PODT_Report_Import Macro
' Macro recorded 19/08/2009 by gsmart
'

'
Sheets("PODT Import").Select
Cells.Select
Range("A2522").Activate
Selection.ClearContents

Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User
ID=Admin;Data Source=\\sladmc01\Data\Users_Shared\Stores\1 Procurement
2009\Purchase Orders\PODT Report\PODT Repor" _
, _
"t.xls;Mode=Share Deny Write;Extended Properties=""HDR=YES;"";Jet
OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Dat" _
, _
"abase Password="""";Jet OLEDB:Engine Type=35;Jet OLEDB:Database
Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Globa" _
, _
"l Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet
OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False" _
, _
";Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" _
), Destination:=Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("Sheet1$")
.Name = "PODT Import"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"\\sladmc01\Data\Users_Shared\Stores\1 Procurement 2009\Purchase
Orders\PODT Report\PODT Report.xls"
.Refresh BackgroundQuery:=False

Sheets("PO Status").Select
End With


End Sub

any help?????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top