Ryan Westerberg <phoenix_016 / hotmail.com> wrote: > Hello everyone, > > I have a bit of an issue that I'm trying to work through pertaining to > opening an excel file I want to open using ruby. I tried looking in > google and all sorts of places but all I could really find is how to > open a new file of Excel. This I can do no problem, however I am unable > to open an existing file. > > > I am currently using: > > Mac OS X v 10.4.11 PowerPC G4. > Ruby v1.8.6 > Rubygems v1.3.4 > > > On the mac my beginning code looks like this > > #!/usr/local/bin/env ruby > > require 'rubygems' > require 'appscript' > > > #This script retrieves the data from excel and puts it into arrays > class Test_arraydata > > def EXTCOdata(*arrays listed here, removed for security purposes) > begin > > #opens excel > $excel=Appscript.app('Microsoft Excel') > workbook=$excel.activate('\Automation\Safari\<Data location>') So, you're doing this with appscript? Well then, in the first place, "activate" is not "open" (and in any case "activate" doesn't take any arguments, and doesn't return a value). If you mean "open", say "open". Next we come to your argument. What is that funny string with backward slashes? If it is meant to be a posix path, it would need forward slashes. But in any case, "open" does not take a posix path. You need to use an alias (i.e. a MacTypes::Alias). So, for example: require 'appscript' f = MacTypes::Alias.path("/Users/mattleopard/Desktop/testing.xls") excel = Appscript.app("Microsoft Excel") excel.activate excel.open f I can't tell whether what you need to learn is AppleScript or rb-appscript, but I have a written a print book about the one and an online book about the other: AppleScript: http://oreilly.com/catalog/9780596102111/ rb-appscript: http://www.apeth.com/rbappscript/00intro.html Hope this helps - m.