ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading information from a closed workbook (https://www.excelbanter.com/excel-programming/356070-reading-information-closed-workbook.html)

yhockman1

Reading information from a closed workbook
 

Hi

I need to run a VBA program that reads information from a second excel
workbook.

Is it possible to extract this information while the second workbook is
closed?

Thanks


--
yhockman1
------------------------------------------------------------------------
yhockman1's Profile: http://www.excelforum.com/member.php...o&userid=32474
View this thread: http://www.excelforum.com/showthread...hreadid=522603


MattShoreson[_68_]

Reading information from a closed workbook
 

you'll find the excel tips a wonderful source of information.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=522603


Tom Ogilvy

Reading information from a closed workbook
 
the best answer would depend a lot on the specifics. However, the fastest
way is to put a linking formula in a worksheet and retrieve the information

ActiveCell.Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
' No replace the formula with the value returned
ActiveCell.Formula = ActiveCell.Value

you can do multiple cells this way with one command

with ActiveCell.Resize(50,10)
.Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
.Formula = .Value
End with

If the data is organized like a Database, you can use ADO


http://www.erlandsendata.no/english/...php?t=envbadac

--
Regards,
Tom Ogilvy



"yhockman1" wrote:


Hi

I need to run a VBA program that reads information from a second excel
workbook.

Is it possible to extract this information while the second workbook is
closed?

Thanks


--
yhockman1
------------------------------------------------------------------------
yhockman1's Profile: http://www.excelforum.com/member.php...o&userid=32474
View this thread: http://www.excelforum.com/showthread...hreadid=522603




All times are GMT +1. The time now is 06:27 AM.

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