Creating a new Excel 2004 Sheet

Hello:

I am comfortable with Applescript, but have only recently (in the last 3 days) installed and been trying to script Excel 2004. I found the dictionary to be rather intimidating, but I did find a nifty pdf at Microsoft with some seemingly useful information on scripting Excel with AS. But, I am stuck on the first page. I simply want to make a new sheet, plug some data into the cells, and save it to the desktop. I cannot even get the code (see below) that MS provided in the PDF to function. I have read a number of threads today that skirt the topic, and I will play some more tonight when I get home, but I would greatly appreciate any other comments by experienced Excel scripters. Here is what I have tried so far. It compiles, but I continue to get the error: “Can’t make new workbook”

tell application “Microsoft Excel”
activate
set newBook to make new workbook
set update remote references of newBook to true
save workbook as newBook filename “testing.xls”
end

Those commands are directly copied from the PDF. The funny thing is that a workbook or sheet does actually appear, but the script still shuts down and I get the error. I kept playing with it, trying different things, and by the time I was done, Excel had 8 open workbooks, but still always produced the error at the make new workbook line.

Do I need to make a dummy workbook or worksheet first?

The end project is a collection of disks that contain mp3 files. I have a rather nifty script that extracts the data I want from those files and right now writes a huge tab-delimited file. I would like to use Excel to hold and manipulate the catalog database, but these are the problems I am experiencing.

Thank you again.

Craig A. Smith

Model: Powermac dual G4
AppleScript: 1.9.3
Browser: Firefox 1.0
Operating System: Mac OS X (10.3.9)

That sample code works fine for me - Excel 2004 on OS 10.3?

Right. My whole system works fine. I admit I cannot get the stupid wildcard things to work in bash on the terminal, but I live with it. I have written scripts for iTunes, iPhoto, and scripts with no calling of applications at all. I have even written a few shell scripts (very few). This is really bugging me; I cannot believe it to be that difficult. I came across a few threads about some gallery thing that needs to be turned off, so I am going to try that next when I get home tonight. (I have my little G3 iBook at the office here. No Excel to distract me here at work.)

Craig

The gallery actually is set open on mine, and it does, but the script ignores it.-

Hmmm. Maybe your Excel is unknowingly broken?

Interesting thought. The installation disk is over a year old, and my machine is not hooked up to the internet at home. I suppose that there could be some updates out there that need to be installed. Incidentally, it is a teacher/student edition with three keycodes; I “purchased” the third keycode from a good acquaintance who was not using it. It is definitely food for thought, although I just hauled that boat anchor home and dread hauling it back here just to update the dang software. Oh well.

Thanks for the thought; it is sure to keep me awake tonight.

Craig