PhoenixRed
New Member
- Joined
- Sep 12, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi!
I want to break all links to the workbook and save it like filename = "CurrentWorcbookName" & "BL" suffix? How I can do it dynamically (grab current name and add BL suffix), help please?
I want to break all links to the workbook and save it like filename = "CurrentWorcbookName" & "BL" suffix? How I can do it dynamically (grab current name and add BL suffix), help please?
VBA Code:
Sub BreakLinksAndSaveWB()
Calculate
' Break all links in wb
Dim wb As Workbook
Set wb = Application.ActiveWorkbook
If Not IsEmpty(wb.LinkSources(xlExcelLinks)) Then
For Each link In wb.LinkSources(xlExcelLinks)
wb.BreakLink link, xlLinkTypeExcelLinks
Next link
End If
ChDir "C:\temp"
ActiveWorkbook.SaveAs Filename:="C:\temp\Test 1 BL.xlsb", FileFormat:= _
xlExcel12, CreateBackup:=False
End Sub