Re: MS Excel help !!!
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.