Applescript for getting data from a spreadsheet

zryip theSlug zryip.theslug at
Fri Dec 9 14:40:41 EST 2011

On Fri, Dec 9, 2011 at 5:49 PM, Bob Sneidar <bobs at> wrote:
> This may be a little off topic, but the goal is to create an app that looks up mac addresses from a telnet session into a series of procurve switches, and then compare that with a known list of mac addresses in an excel spreadsheet, and trace them through a network to find where the device is at. I do this regularly by hand, but I want to make a stack that can do it.
> I read through the dictionary of Microsoft Excel to try to find a way to get the data from a range of cells, but as usual, nothing works in Applescript like you would expect, and of course the dictionary provides no examples of how the command should be written. All the help forums are useless because the advice people give there is usually either outdated, or simply wrong on it's face.
> So does anyone have any experience using Applescript to select a range of cells in a certain sheet of a certain workbook? If I could get that far, I think I could just copy/paste the data into a datagrid and go from there. BTW I am using Office 2008 (for Mac of course). This is important because apparently they rewrote the dictionary between 2004 and 2008 and a lot of things that used to work in 2004 do not anymore.

Hi Bob,

Did you try something like this?

tell application "Microsoft Excel"
     set myRange to range "A1:A5" of sheet "mySheet" of workbook "myWorkbook"
     return value of myRange
end tell

This should return a list of values between {} and separated by commas.

Best regards,
-Zryip TheSlug- wish you the best! 8)

More information about the Use-livecode mailing list