newbie - Excel/Applescript

HI -

I am new to Applescript. I am needing to have a range of cells have a certain number added to them each time my script is run.

ie - R10000 will become R10000+1000 when the script is run next or R11000.

I can open Excel and get to my worksheet - but I can’t seem to get the cell or cells I need and then manipulate them. Could you please give me some hints or help or let me know if I am going the totally wrong direction.

Thanks.

It is really very easy- here are some ideas.

tell application “Microsoft Excel”
– get a value from a cell
set nPartsShip to Value of Cell “R1C1” of Worksheet “Shipped” of workbook “Shipments”
– set the value of a cell
set Value of Cell “R2C1” to 10
– or you can use named ranges
set value of cell “firstItem” to 100.0
end tell

to increment a value each time a script is run may require you to keep that value in a property that is persistent

just declare the property variable at the top of your script.

Get the book Applescript for Applications by Ethan Wilde.

Great info. Thanks!

I’m having a problem specifying a path name to an excel spreadsheet that isn’t on the desktop. My script so far is:

tell application “Microsoft Excel”
launch
Activate
Open “test.xls”
set mailValue to Value of Cell “A1” of Worksheet “Sheet1” of Workbook “Test.xls”
end tell

It returns the right number, but if text.xls is anywhere but on the desktop, it gives me an error.

I’m writing the path as: “George/Users/Eric/Documents/Finance/test.xls.”

George is the Hard drive’s name.

Also, if I have the cell (A1 in this case) formatted as currency, it returns zero. If it’s plain text, it returns the number (in this case 125). :?: