birdmancpa
New Member
- Joined
- Sep 15, 2016
- Messages
- 2
Hi,
Can anyone help me create VBA code for converting formulas/links only relating to external program data sources (and leaving regular functions, links to worksheets and outside workbooks in tact)??
So far this is what I have written:
Sub Break_Links_To_External_Program_Links()
'Convert formulas that point to plugin data sources to values
'It will not convert other Excel formulas to values.
Dim xLink As Variant
xLink = Application.ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Do Until IsEmpty(xLink)
Application.ActiveWorkbook.BreakLink Name:=xLink(1), Type:=xlLinkTypeExcelLinks
xLink = Application.ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Loop
End Sub
If the external program functions are as such: =SMAcctBal($A37,$C$1,C$2,"A","P")
can I replace the 1 in [Name:=xLink(1)]
with SMAcctBal
Any help is greatly appreciated.
Thanks
Can anyone help me create VBA code for converting formulas/links only relating to external program data sources (and leaving regular functions, links to worksheets and outside workbooks in tact)??
So far this is what I have written:
Sub Break_Links_To_External_Program_Links()
'Convert formulas that point to plugin data sources to values
'It will not convert other Excel formulas to values.
Dim xLink As Variant
xLink = Application.ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Do Until IsEmpty(xLink)
Application.ActiveWorkbook.BreakLink Name:=xLink(1), Type:=xlLinkTypeExcelLinks
xLink = Application.ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Loop
End Sub
If the external program functions are as such: =SMAcctBal($A37,$C$1,C$2,"A","P")
can I replace the 1 in [Name:=xLink(1)]
with SMAcctBal
Any help is greatly appreciated.
Thanks