Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Retrieve selected data from Network file

Hi,

I have posted about this a few months ago and never really found a
solution and am having to make do, however the problem is getting
larger and i really would appreciate some help.

I have a spreadsheet (lets call it file a) used by 100 ish people each
with their own local copy. This spreadsheet has code to retrieve data
from another spreadsheet (file b) stored on a network drive. File b on
the network drive has over 60000 rows of data. However the data
required by each user is only approx 3000 rows. The network connection
speed is slow.

I need to retrieve the data without opening file b. Each user
retrieves different data, filtered by a unique code for each user
which is is column c of file b.

I currently use the code below to retrieve the data.

Sheets("Sheet1").Range("A1").Select
With Selection.QueryTable
.Connection = _
"ODBC;DSN=Excel Files;DBQ= " & PATHANDNAMEANDTYPE &
";DefaultDir= " & PATH &
";DriverId=790;MaxBufferSize=2048;PageTimeout= 5;"
..CommandText = Array( _
"SELECT `" & FILNAMES & "`.`This Id`, `" & FILNAMES & "`.Outlet, `" &
FILNAMES & "`.`Street Address`, `" & FILNAMES & "`.Locality, `" &
FILNAMES & "`.Town, `" & FILNAMES & "`.County, `" & FILNAMES &
"`.`Outer Postcode`, `" & FILNAMES & "`.`Inner Postcode`, `" &
FILNAMES & "`.`Phone No#`, " _
, _
"`" & FILNAMES & "`.`Outlet Status`, `" & FILNAMES & "`.Tenure,
`" & FILNAMES & "`.`Primary Streetmap`, `" & FILNAMES & "`.`Last BDE
Visit`, `" & FILNAMES & "`.Owner, `" & FILNAMES & "`.Operator, `" &
FILNAMES & "`.`BDE Territory`, `" & FILNAMES & "`.Region, `" &
FILNAMES & "`.Division" & Chr(13) & "" & Chr(10) & "FRO" _
, _
"M `" & PATHANDNAME & "`.`" & FILNAMES & "` `" & FILNAMES & "`" &
Chr(13) & "" & Chr(10) & "WHERE (`" & FILNAMES & "`.`BTerritory`='" &
BNO & "')" _
)
.Refresh BackgroundQuery:=False
End With

However this takes around 9 minutes!

I have tested and i can retrieve a named range (eg. a1:p5000) from the
same file in 70 seconds (obviously no querying / where clause to
filter records involved). It is because of this I feel i should be
able to improve the time it takes to query the records and retrieve
the matching ones.

I did think about copying the whole sheet of file b and filtering once
copied into file a but this causes out of memory errors.

I have been previously pointed towards ado however I cannot see how i
can filter the records using this method.

This is seriously hindering the use of this file and i would
appreciate ANY help or suggestions.

Thanks,
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I retrieve data from zip file into excel? Eric Excel Discussion (Misc queries) 5 November 26th 07 09:07 PM
Retrieve data from all of the worksheet within the file dannyboy213 Excel Worksheet Functions 1 March 22nd 06 06:51 PM
retrieve and update data from a dbf file alfonso gonzales Excel Programming 0 October 2nd 04 11:57 PM
Access and retrieve data from network workbook Max Potters Excel Programming 9 August 18th 04 01:05 AM
Access and retrieve data from network workbook Max Potters Excel Programming 0 August 17th 04 12:41 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"