Solved

Linked sheets not found when opening a workbook

Posted on 2011-03-01
7
196 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 44

Author Comment

by:AndyAinscow
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

744 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