• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Excel: Breaking External Links
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Excel: Breaking External Links


  • Subject: Excel: Breaking External Links
  • From: Cameron Knowlton <email@hidden>
  • Date: Sun, 13 Feb 2011 19:32:26 -0800

Title: Excel: Breaking External Links
I'm trying to break all existing links in an Excel [2008] document, without reverting to System Events and menu manipulation.

I can't seem to get Applescript Break Link command to work, e.g.:

tell application "Microsoft Excel"
     
set currentDoc to active workbook
      
set listOfLinks to (link sources currentDoc)
   
       
repeat with theLink in listOfLinks
                set theLinkInfo to link info theLink -- error: Microsoft Excel got an error: item 1 of {"Tesla:Users:cameron:Data:Detail_20110207.xls"} doesn't understand the link info message
                set theLinkName to name of theLink -- error:Can't get name of "Tesla:Users:cameron:Data:Detail_20110207.xls".
          
set theLinkType to type of theLink -- error: Can't get |type| of "Tesla:Users:cameron:Data:Detail_20110207.xls".
               
break link currentDoc name theLink type theLinkType -- error: Microsoft Excel got an error: active workbook doesn't understand the break link message.
 
end repeat
     
end tell


The value of theLink is its source file path; it has no name for me to reference.

The only way that I can figure to break these links is through menu manipulation (yuk!... but this *does* work):

tell application "Microsoft Excel"
     
       
activate
       
tell application "System Events"
               
tell process "Microsoft Excel"
                 
click menu item "Links..." of menu "Edit" of menu bar item "Edit" of menu bar 1
               
click button "Break Link" of window "Links"
                    
delay 2
               
keystroke return
                       
delay 2
               
click button "Close" of window "Links"
         
end tell
       
end tell
       
end tell

Has anyone had experience doing this a better (proper) way?

Thanks everyone.
Cam
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: read stored variables in run only script application
  • Next by Date: Re: Excel: Breaking External Links
  • Previous by thread: Re: Change a file date (creation and modification)
  • Next by thread: Re: Excel: Breaking External Links
  • Index(es):
    • Date
    • Thread