Hey there
I’ve been tasked with scripting the movement of data around a NeoOffice Spreadsheet (2.1 Patch 1). Previously, I had used Microsoft Excel 2004 for Mac and used my old friend (I don’t get out much) of
tell application "Microsoft Excel"
activate object sheet "Sheet1" -- Make sure correct page is prepared to be pasted to
--Data Grab portion--
paste worksheet active sheet destination range "A1" --Ensures correct cell is consistently pasted into
--
copy range range "O27" -- Copy the value of SN Ratio Up
--
activate object sheet "Sheet2" --Jump to the results sheet
--
activate object cell "D2" -- Activate Up Ratio cell
--Next we use a customised keystroke to paste just the value of the result, not the actual formula of the cell. We employ system to do this, so close the Excel function here--
end tell
tell application "System Events" --Utilises the Keyboard Shortcuts with Mac
keystroke "v" using {command down} -- Paste
delay 0.5 --Added this because Excel needs a small pause between pasting and making that paste a "Paste Values" - Don't know why
keystroke "q" using {control down} --Customised Excel Keyboard Shortcut for function "Paste Values"
--NOTE- This keystroke must be set in Excel-Tools-Customize-Customize Keyboard for this function to work.
end tell
Unfortuately, I can’t seen to make the excel commands stick in Open(Neo)Office…has anyone had success scripting NeoOffice Spreadsheet to perform the tasks of:
–Move to a specific cell (ie : activate object cell “D2”)
–Paste clipboard to a specific cell (ie paste worksheet active sheet destination range “A1”)
Thanks all
Martin
Model: MiniMac (G5 Power PC), iMac (Intel), iMac (G5 Power PC)
AppleScript: 1.10.7
Browser: Firefox 2.0.0.3
Operating System: Mac OS X (10.4)