Applescript for getting data from a spreadsheet

zryip theSlug zryip.theslug at gmail.com
Fri Dec 9 18:02:45 EST 2011


On Fri, Dec 9, 2011 at 11:32 PM, Bob Sneidar <bobs at twft.com> wrote:
> Ok now my problem is I am trying to open the file via Applescript. The dictionary says:
> open workbook v : Opens a workbook.
>
> Hence this appleScript:
> tell application "Microsoft Excel"
>        activate
>        set the default file path to "Volumes/data/LogosAdmin/TechData/Tech Documents/"
>        open workbook "DHCP Clients.xlsx"
>        copy range range "B:E" of sheet "DHCP Clients.xls" of workbook "DHCP Clients.xlsx"
> end tell
>
> It stops at open workbook "DHCP Clients.xlsx":
> error "Microsoft Excel got an error: \"DHCP Clients.xlsx\" doesn’t understand the open workbook message." number -1708 from "DHCP Clients.xlsx"
>
>
> I feel like an ignorant putz, but shouldn't I be able to open a frickin workbook like this?? With Applescript I feel like if I type two spaces where it expected one the computer will shut down and never restart again just to punish me for being such an imbecile.

8-)

The Excel documentation has numerous traps. Sometimes the syntax is
natural and sometimes... surnatural. ;-)

Try:
open workbook workbook file name "DHCP Clients.xlsx"


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.com




More information about the Use-livecode mailing list