I’ve been searching for a paste command for Excel 2004. This should be much more simple than it is.
I know that my script is doing the right things up until paste, because I tested the data in the clipboard and it is perfect.
A lot of paste inquiries dance around this subject but nothing nails it.
Help!
Dzelnio
on run
idle
end run
on idle
tell application “Finder” to set t_file to (duplicate “Macintosh HD:WordCounts.xls” to “Macintosh HD:wcounts” with replacing) as Unicode text
tell application "Microsoft Excel"
open t_file
set oldValue to display alerts
set display alerts to false
save workbook "WordCounts.xls" in t_file as Excel9795
set display alerts to oldValue
tell application "Microsoft Excel"
copy range range "A:D" of the active sheet
end tell
close workbook "WordCounts.xls"
end tell
tell application "Microsoft Excel"
open "Macintosh HD:wcounts:WCSlave14.xls"
set oldValue to display alerts
set display alerts to false
tell application "Microsoft Excel"
get sheet "Details"
set cells_toPaste to {A:D}
end tell
save workbook "WCSlave14.xls"
set display alerts to oldValue
end tell
close
return 60 * 60 -- one hour, in seconds
end idle
===
THE ERROR
set display alerts to false
get sheet “Details”
sheet “Details”
“The variable D is not defined.”