Link to home
Start Free TrialLog in
Avatar of stadiumred
stadiumred

asked on

How do I disable the "Update Values:" dialoge box when Replacing linked values with a link location that doesn't exist yet?

I'm trying to replace cells in my worksheet that are linked to a worksheet that has yet to be created.  The problem is that when I use the find replace function each cell that has the link changed to a nonexistant file yeilds an "Update Values:" dialogue box that prompts me to link the value to an existing workbook.  Is it possible to turn off or diable this "Update Values:" dialogue box so that I just be the #REFs for now? Creating dummy files is not an option as there are too many that would need to be done. Thanks!!
Avatar of riteshparakh
riteshparakh
Flag of India image

Why not replace all your = (equal signs) with '= and convert them to text
.
.
then edit all your formulae .. links etc to whatever you want
.
.
and then again replace all '= with =

Ritesh
Avatar of Dave
You can do this with code and suppress the warning with Application.DisplayAlerts set to False
for example, if you have valid workbook links to
C:\test\main.xls
you could replace them with this code that links to a non-existent workbook without any prompts
Cheers
Dave
 

Sub Macro3()
    Application.DisplayAlerts = False
    ActiveWorkbook.ChangeLink "C:\test\main.xls", "C:\test\doesnt exist.xls"
    Application.DisplayAlerts = True
End Sub

Open in new window

Avatar of stadiumred
stadiumred

ASKER

riteshparakh, that didn't work, it won't change it back to a link. thanks anyway.
brettdj, this is a stupid question but where does the code snippet go? Do I start a macro to do this?
Sure. I should have provided this up front. From your workbook with the links
  1. Hit Alt & F11 to go to the VBE
  2. Insert - Module
  3. Copy and Paste the code I provided
  4. Update the relevant paths to the current link, and your future dummy link  (ie C:\test\main.xls is the current linked path)
  5. Hit Alt & F11 to go back to Excel
  6. Run the macro via Tools ... Macro .... Macros and click on the unimaginatively named Macro3
Cheers
Dave
thanks that makes sense! Is there a way to do a find/replace in that macro? For example C:\test\main.xls may have 12 variations, C:\test\main1.xls, C:\test\main2.xls, C:\test\main3.xls etc and I want them to just change out "main" with "new" and keep the number after it?
ASKER CERTIFIED SOLUTION
Avatar of Dave
Dave
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you so much, you just saved me hours of work!
No probs, thx for the grade :)