Checking the existence of a reference workbook

  • Thread starter Thread starter Frederick Chow
  • Start date Start date
F

Frederick Chow

I have a workbook ("C") which references other subroutines of another
workbook ("R"). When C is opened, R should have been automatically opened.
If somehow R cannot be opened, is it possible to write code to check the
existence of R? Seems that a IsWorkBookExists macro cannot do the job.
Thanks for your advice in advance.

Frederick Chow
 
If C references R, opening R will cause C to be opened as well.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Seems not possible, if workbooks C1, C2, C3.... Cn all reference workbook R,
then did you mean that if R is opened, then C1, C2, C3.... , Cn will be
opened simultaneously??

By the way, the issue is that in case the required R does not exist, I wish
that such error could be handled by my own code located in any C's, not by
the Excel compiler itself. Is it possible?

Frederick Chow
 
When a workbook references another workbook, the referenced
workbook will be automatically opened when the referencing
workbook is opened. The opposite is not true. If a referenced
workbook is opened, those workbooks that reference that workbook
will not be opened. Thus, using your example, opening any C
workbook will cause R to open, but opening R will not cause any C
workbook to open.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
OK, that's what I know of.

Anyway, what happened if R did not exist and C is opened? If errors occured,
is it possible to handle by VBA code located in C? This is my main question.

Frederick Chow
 

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