Archive of Mr Excel Message Board

Back to Excel VBA archive index
Back to archive home

A macro putting data in a closed workbook?
Posted by Paul Magruder on March 20, 2001 7:54 PM
Is it possible to run a macro in "Book1" and have the macro put the data in "Book2" if Book2 is closed? Example: Workbook "Book1" has data in "sheet1" range ("a1")
I want to put the data in the same range in workbook "Book2" without opening workbook "book2".
I know how to do it if both workbooks are open, but can i do it if one of them is closed?
Thanks in advance...... Paul

| Check out our Excel VBA Resources
|
 |
 |
 |
 |
 |
Re: A macro putting data in a closed workbook?
Posted by David Hawley on March 21, 2001 12:36 AM
Hi Paul
I think you will find the answer is no! The method I use to overcome this is to have a macro in the Workbook_Open event that places formulas (simple or complicated) in the appropriate cells to reference the other workbook. I then use SpecialCells to eliminate any Errors, blanks etc. The code then converts these to Values only.
When done correctly you will not even notice it happening.
Dave
OzGrid Business Applications

I was thinking...
Posted by David Hawley on March 21, 2001 4:13 AM
Paul, as you will not actually see the data inputed into the closed workbook unless you open it, or extract it while it's still closed. I thought this may be of intrest to you:
http://www.j-walk.com/ss/excel/tips/tip82.htm
Great site too!!
Dave
OzGrid Business Applications

Re: Thanks
Posted by Paul Magruder on March 21, 2001 9:51 AM

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.