• 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
Opening Documents in Excel with Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opening Documents in Excel with Applescript


  • Subject: Opening Documents in Excel with Applescript
  • From: "Borsz, Andy" <email@hidden>
  • Date: Thu, 20 Jul 2006 14:24:27 -0400
  • Thread-topic: Opening Documents in Excel with Applescript

Title: Hello,

Hello,

I’m having significant problems trying to open a file in Microsoft Excel X for Mac with Applescript.

 

Here’s my code:

 

set repo_prompt to "Please select document"

 

set f_default to path to desktop folder as alias

 

set repo_design to choose file with prompt repo_prompt default location f_default without invisibles

 

tell application "Microsoft Excel"

      Activate

      Open repo_design

end tell

 

I select a .xls document when prompted and then I get the Applescript Error: “Microsoft Excel got an error: ‘’ could not be found.__Check the spelling of the file name, and verify that the file location is correct. If you are trying to open’’”

 

In the event log it shows that when I select my document It returns it as:

 

Alias “G4-PB2:Users:etc”

 

as would be expected.

 

If I switch the line tell application "Microsoft Excel" to tell application "BBEdit" and select a .txt or .xml file BBEdit opens the file fine as I would hope. Can anyone tell me why Excel is rejecting my code?

 

Thanks very much for your time, and have a good day.

 

Andy

 

 

 

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Opening Documents in Excel with Applescript
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Keys Pressed OSAX
  • Next by Date: Keychain scripting
  • Previous by thread: Re: Keys Pressed OSAX
  • Next by thread: Re: Opening Documents in Excel with Applescript
  • Index(es):
    • Date
    • Thread