Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Emily Diaz   on Oct 13 In MS Office Category.

  
Question Answered By: Jae Williams   on Oct 13

There was a method I used long ago, for extracting data  from a
damaged (a.k.a. target) file (up to the error). It obviously works
for good files  as well. It involved creating an ordinary link to a
cell in the target (unopened) file using a simple formula in a cell in
the destination (open file). I imagine the equivalent can be done in
VBA to reference unopened File data by building the object acession
out to the unopened file - don't know, but this could come in handy
for my current projects.


Lets see it I remember enough... It may be equivalent to ADO. I don't
know.

1- Open a new ("dummy") workbook. Name doesn't matter, It will be
discarded later.

2- Open the "destination" workbook. Where you want the data to
appear and be used.

3- Select (Click on) a cell in the "destination" sheet where you want
one of the cell's data to GO.
Type an Equals sign "=". Now go into the dummy Sheet and Select
(click on) the cell where the data *would be* if this had been the
Target (Un opened) file. Type ENTER. This creates a link to the
*location* from which you want data retrieved, but not the actual file.
You are now back in the Destination file. Where the "Dummy"
FileName has been automatically inserted into this formula.

4- Change the FileName in this foemula to the actual Target FileName.
Being careful to preserve the rest of the formula { the ' and !
characters, etc.). There is probably an issue with the Path of the
Target file. I believe this method works if all files are in one
directory. Otherwise The full FileName.Path is probably needed in
this step.

6- Now just Copy this formula into all cells where you want to get
data "from" in the Target File. NOTE: This is where the data is in
the Un-opened "Target" File. This effectively duplicates the Target
Sheet's data.Values as well as locations. The formulas will
automatically maintain the relative references just as in a single
sheet. AND the data automagiclly appears in the destination sheet.

In General, you can get the data from *any* cell in the un-opened
sheet by simply setting that cell reference-Address in the formula.
You determine in which cell in the destination sheet the data appears,
by the *location* of the formula.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Extract data without opening workbook Or get search suggestion and latest updates.


Tagged: