ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   accessing a workbook cell in a different directory (https://www.excelbanter.com/excel-programming/313832-accessing-workbook-cell-different-directory.html)

meefongh

accessing a workbook cell in a different directory
 

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

--
meefong
-----------------------------------------------------------------------
meefongh's Profile: http://www.excelforum.com/member.php...fo&userid=1538
View this thread: http://www.excelforum.com/showthread.php?threadid=27004


agarwaldvk[_36_]

accessing a workbook cell in a different directory
 

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

--
agarwaldv
-----------------------------------------------------------------------
agarwaldvk's Profile: http://www.excelforum.com/member.php...fo&userid=1134
View this thread: http://www.excelforum.com/showthread.php?threadid=27004



All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com