accessing a workbook cell in a different directory

  • Thread starter Thread starter meefongh
  • Start date Start date
M

meefongh

Hello,

Can anyone tell me how i can access a workbook from a differen
directory.

For example

Range("A1").Value
Workbooks("Raoul.xls").Worksheets("Sheet1").Range.("A1").Value

the above code works fine assuming the two workbooks are in the sam
directory.

However:
Range("A1").Value
Workbooks("c:\temp\Raoul.xls").Worksheets("Sheet1").Range("A1").Value

The same code in a different directory does not work? How can i acces
a workbook from a different directory.

Help will be greatly appreciated.
Me
 
Hi Mee

This won't work as you intend it to! If your referred workbook i
closed, please see John Walkenback site to access data from close
workbooks!

If your referred workbook is open then you don't have to include th
path, the filename alone should work fine!

Try this and I believe you should be ok!


Best regards


Deepak Agarwa
 

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

Back
Top