BreakLinks method works when Stepping Through but not when Running!

W

WhytheQ

Dear All,
I have a worksheet with several graphs in it.
The sheet gets copied to create a new workbook then I've atempted to
Breaklinks to the original workbook by using the following code
(straight out of the online help!!).
If I step through the macro then it seems like the links are broken,
but if I just let it run then when I open the workbook (which has been
programmatically attached to and outlook mailitem) then the links still
exist and haven't been broken!!

Any help greatly appreciated,
Jason.


Dim astrLinks As Variant
' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
' Break the first link in the active workbook.
ActiveWorkbook.BreakLink Name:=astrLinks(1), Type:=xlLinkTypeExcelLinks
 
T

Tom Ogilvy

It worked for me (like you indicate it does for you) for an unattached
workbook. Did you save the workbook after breaking the link?

I don't know your situation, but I would make all changes before doing the
attachment. If you want to preserve the original, then make a copy (work
with it), make the changes, do the attachment, send the email, delete the
copy.
 
W

WhytheQ

Thanks are due, as per usual Tom! ... the little line
"Activeworkbook.Save" has made all the difference.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top