VBA: Save As Workbook still refers to original Workbook: Annoying Update Links every time

Bill Bisco

Active Member
Joined
Aug 8, 2007
Messages
446
Dear all,

Any help would be greatly appreciated on this annoying issue.

I have Excel code to save the current workbook with a specified name

Code:
ActiveWorkbook.Sheets.Copy 'Create new workbook
Fname = sItem & "\" & strLegalFileName(MyFile)
    'SAVES FILE USING THE VARIABLE BOOKNAME AS FILENAME 'Replace with proper code to specify location and filename
    ActiveWorkbook.SaveAs filename:=Fname, FileFormat:=52 _
    , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False

Whenever I open up one of the files that was "Saved as" I get that annoying update links message at the top:

It still think that the file that was saved should actually be the original file. In other words, my original file was in Folder1 and named Master and my copied file is in Folder2 and Named Copy1, but Copy1 still retains a link to Master.

I have tried putting in

Application.AskToUpdateLinks = False but that doesn't seem to work.

I can manually edit the TrustCenter settings to prevent the popups, but I cannot force users to change their settings.

Any suggestions?

Sincerely,

Bill
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I got this from StackOverflow website. Give it a try.
Code:
Sub BreakExternalLinks()
'PURPOSE: Breaks all external links that would show up in Excel's "Edit Links" Dialog Box
'SOURCE: [URL="http://www.TheSpreadsheetGuru.com/The-Code-Vault"]www.TheSpreadsheetGuru.com/The-Code-Vault[/URL]
Dim ExternalLinksArray As Variant
Dim wb As Workbook
Dim x As Long
Set wb = ActiveWorkbook
'Create an Array of all External Links stored in Workbook
  ExternalLinksArray = wb.LinkSources(Type:=xlLinkTypeExcelLinks)
'if the array is not empty the loop Through each External Link in ActiveWorkbook and Break it
 If IsEmpty(ExternalLinksArray) = False then
     For x = 1 To UBound(ExternalLinksArray )
        wb.BreakLink Name:=ExternalLinksArray (x), Type:=xlLinkTypeExcelLinks
      Next x
end if
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,981
Messages
6,175,771
Members
452,668
Latest member
mrider123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top