Solved

Linked sheets not found when opening a workbook

Posted on 2011-03-01
7
197 Views
Last Modified: 2012-05-11
When I open a workbook that has links to sheets in another workbook - fine.
However when the workbook being linked to (source) isn't present I get a dialog prompting to edit the links.

Does this come from a workbook event?  Can I trap and provide my own behaviour? If yes then how?

The real situation:  
I have a set of sheets that have the year as part of the name.  Each year there will be a copy put into archive and the year part of the name changed.  eg. SourceA_2010.xls becomes SourceA_2011.xls and so on.
I have the code required to change the links, I have just had the idea it would be nice to run that if required automatically - not having to cancel the default behaviour then run a custom macro.
0
Comment
Question by:AndyAinscow
  • 4
  • 2
7 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 35006908
There isn't an event for that and the prompt occurs prior to any code (including Workbook_Open) running if you have automatic link updating enabled.
0
 
LVL 44

Author Comment

by:AndyAinscow
ID: 35006931
Thanks.
I'll leave it open for a couple of days just in case someone knows different.

(I might explore using an app to copy/paste/rename and then automate excel to modify the paths - but that is something unrelated to this question)
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35006953
You would have to turn off automatic updating of external links, then have your code run in the Open event, check the path for each link and then prompt to update if required.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Author Comment

by:AndyAinscow
ID: 35007053
Not an option :-(
That would affect all other workbooks.


Actually I write too quickly.
If I left the autocheck ON, cancel the dialog then at workbook open I could run my own code to test and fixup the links.
Hmmm, got to think a little about that.
0
 
LVL 3

Expert Comment

by:AL_XResearch
ID: 35009948
HI AndyAinscow,

If I have understood correctly you are repeatadly being asked about external links when a workbook opens which you don't want. I assume you have updated / corrected all the cell links in your workbook. You might try checking the 'Named cell ranges' to see if any refer to an external workbook.

Theses are defined in menu option [Insert - Names - Define ...]. Some of these names may point to ranges in other sheets - in which case you can correct or delete them
0
 
LVL 44

Author Comment

by:AndyAinscow
ID: 35010244
>>If I have understood correctly you are repeatadly being asked about external links when a workbook opens which you don't want.

No.  Links are fine, they are required.  This is a one off behaviour because the links are being deliberately broken.

I'm having a rethink based on comments by rorya.  The following is the critical bit of my original question.

When I open a workbook that has links to sheets in another workbook - fine.
However when the workbook being linked to (source) isn't present I get a dialog prompting to edit the links.

Does this come from a workbook event?  Can I trap and provide my own behaviour? If yes then how?


0
 
LVL 44

Author Closing Comment

by:AndyAinscow
ID: 35017642
Actually Workbook_Open is fired before this dialog (at least on my PC and excel version).  I check if a link is broken and then remake the links.  However now comes the dialog prompting for the edit links, with the OLD paths.  Cancel this dialog, save and close, open again and no dialog because the links are OK.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now