LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default Changing Links In Excel Causes Formulas To Change

I've got a workbook called sec_model.xls. This file contains a link to a file
called output.xls. This output.xls is created by a macro in another file.

I'm writing a macro to run several different scenarios in sec_model.xls, and
as part of that I programmatically change the link source. I know how to do
this. However, whenever I do that, the formulas that refer to the linked
sheet turn into #REF! errors.

Here is the code to change the link: ThisWorkbook.ChangeLink strOldInput,
strLoanOutput

For instance, a formula that says "='C:\[output.xls]loan cash flows'!C14"
will change to "='C:\[output.xls]#REF!'!C14" after I run the code.

I have tried running this code with the "output.xls" file open or closed,
and it doesn't make a difference. I can tell you that in 90% of cases,
strOldInput and strLoanOutput will be the same file (in other words, I'm
"changing" the link to be the exact same file it's already linked to).
However, I do that manually all the time and it doesn't cause a problem.

Any thoughts or ideas as to what the problem could be?
--
Hmm...they have the Internet on COMPUTERS now!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Links: Changing links on a protected worksheet Halibut68 Excel Discussion (Misc queries) 0 April 28th 06 11:03 AM
change file links or updating formulas [email protected] Excel Programming 1 December 6th 05 04:41 PM
Links in formulas change when another user runs a workbook - 2003 L Mehl Excel Programming 3 November 28th 04 04:59 AM
Links in formulas change when another user runs a workbook L Mehl Excel Discussion (Misc queries) 2 November 27th 04 09:27 PM
Changing Links in Excel with VBA Tom Hickey Excel Programming 1 September 1st 03 11:28 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"