Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Updating links to add-ins

0 views
Skip to first unread message

BigJimmer

unread,
Dec 9, 2009, 2:39:02 PM12/9/09
to
Whenever a workbook is copied from one drive to another, Excel changes the
links path for the various add-ins being used. Bill Manville kindly provided
some code to help with updating these links when this happens (8/27/2009).

Part of the code is this....

With ActiveWorkbook
.ChangeLink stSourceName, Workbooks(stFileName).FullName
End With

When I manually run the routine that contains this statement, everything
works fine.

However, it doesn't work when this same routine is included in the
Worksheet_Open event processing that I run. During that process, the
.ChangeLink statement runs, and appears to update the link. Other UDF's are
then run, and I'm guessing it's because it is those that utilize the linked
file. Then the code returns to .Changelink line and attempts to update the
link again. It's at this time that a type mismatch error is returned, and
iappers to be impossible to trap this error.


Any idea of why this works differently in these two situations?

Thx.

Bill Manville

unread,
Dec 24, 2009, 2:18:38 AM12/24/09
to
It probably decides that a recalculation is in order after it has
changed a link; that will recalc the UDFs in appropriate circumstances.

I would suggest getting Workbook_Open to call the link-changing
procedure after the other workbook open actions have completed

Workbook_Open does
Application.OnTime Now, "LinkChanger"
and
Sub LinkChanger() in a normal module does what Workbook_Open used to
do.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

BigJimmer

unread,
Jan 5, 2010, 1:46:01 PM1/5/10
to
Thank you, that seems to have done the trick!!

"Bill Manville" wrote:

> .
>

0 new messages