View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
add add is offline
external usenet poster
 
Posts: 4
Default Error retrieving data from closed workbook

Data is entered in these cells, there are no formulas in the cells from where
I am exctracting data.

I tried ADO to extract data too, howevere it gives an error too. One thing I
noticed that some of the excel workbook are protected (i.e. protect workbook
structure and windows).

So it is giving error for the files where this workbook protection is on,
however issue is, it is still able to read data from couple of cells from
these workbooks.


"Jim Cone" wrote:


More...
Ron de Bruin show how to use ADO to extract data from
closed workbooks here... http://www.rondebruin.nl/ado.htm
--
Jim Cone



"Jim Cone"
wrote in message
Do the questionable cells have formulas in them that refer to other workbooks?
If so, my guess is that the cell values are #N/A when the workbook is closed.
(kind of analogous to "is the refrigerator light on when the door is closed)<g
You could turn off Screen Updating and open - read - close each file.
Unless the files are very large, there shouldn't be much time difference.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Add" wrote in message
Hi Jim,
I applied the code that you have given, still I am getting same error 2042.
The workbook has data in cells C9, F9, I9 and so on. It gives error for cells
c9 and f9 and is returning correct value for cell I9.

If I open the wrokbook with this data then it is able to read cell c9 and f9
correctly. What else could be wrong?
Thanks
ADD