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)