I've open an EXCEL via the following command:
XLOpen>%PathFileName%,0,XLBookHandle
The EXCEL has several links.
What's the best way to BREAK all links and save file as
PathFileName_no_links
Thanx.
... Michel
EXCEL: How to break all links before saving
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Just answered this privately so for benefit of everyone else here's some code that will attach to XL and break the links in the active workbook:
Code: Select all
//put this block at top
VBSTART
Dim xlApp
Dim xlBook
Sub GetXL
Set xlApp = GetObject(,"Excel.Application")
Set xlBook = xlApp.ActiveWorkbook
End Sub
Sub BreakLinks()
Dim astrLinks
If Not IsEmpty(xlBook.LinkSources(1)) Then
For Each Link in xlBook.LinkSources(1)
xlBook.BreakLink Link, 1
Next
End if
End Sub
VBEND
//call these lines to break the links before saving and quitting
VBRun>GetXL
VBRun>BreakLinks
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?