• 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
Re: MS Excel help !!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MS Excel help !!!


  • Subject: Re: MS Excel help !!!
  • From: Craig Sutherland <email@hidden>
  • Date: Sat, 22 Dec 2001 21:34:21 -0600

There are several ways to do this. Here are two-

Both is is use the Try construct. If the file exists, it will open. If
not, you can pass a message to the user and stop the script.

Example:

set generale to "Macintosh HD:Desktop
Folder:FantaKapNew:Formattazioni:XLS: (line split)
& (numGiornata) & ":Generale.xls"

try
tell application "Finder"
open FileTocheck
end tell
on error
display dialog "File not found!" buttons {"OK"} default button 1
if result is "OK" then
return
end if
end try

Or-

Try
set generale to "Macintosh HD:Desktop
Folder:FantaKapNew:Formattazioni:XLS: (line split)
& (numGiornata) & ":Generale.xls" as alias
on error
Display Dialog "File not found!" buttons {"OK"} default button 1
if result is "OK" then
return
end if
end try

HTH

Craig

On Saturday, December 22, 2001, at 09:30 AM, rhyme wrote:

> How do i use the command exists in Ms Office ??
> i want to open a file if this exists into the directory !
> i've tried with this script but it doesn't run :
>
> set generale to "Macintosh HD:Desktop
> Folder:FantaKapNew:Formattazioni:XLS:"
> & (numGiornata) & ":Generale.xls"
>
> tell application "Microsoft Excel"
>
> if exists generale then
> Open generale
> end if
>
> end tell
>
> Thanks
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.


References: 
 >MS Excel help !!! (From: rhyme <email@hidden>)

  • Prev by Date: For want of a better ASS reference
  • Next by Date: Scripting in Word
  • Previous by thread: MS Excel help !!!
  • Next by thread: Re: MS Excel help !!!
  • Index(es):
    • Date
    • Thread