Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Applescript with Excel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applescript with Excel



Throughout the several months that I have been lurking on this list, I have
seen little discussion about using Applescript with Excel. I have a situation
where I am trying to run Applescripts from within FMPro 5 scripts that get
data from an Excel file into the FMPro file. When I run the following:

tell application "Microsoft Excel"
Activate
Evaluate "ExcelFile!ExcelMacro1()" --the macro works fine from within
Excel
--this simply copies the data in one cell to the clipboard
end tell
tell application "FileMaker Pro"
activate
set cell "TestCell" to the clipboard
end tell

I get an "out of memory" error at 'set cell "TestCell" to the clipboard'.
When I go to the Finder and check the contents of the clipboard, the
clipboard does contain the data I want it to contain.

In another situation, a script which tells Excel to do X, completes X, but
the script gets stuck at the end of the Excel "tell":

set Var1 to 12
tell application "Microsoft Excel"
Activate
Select Sheet "Sheet3"
Select Range "R1C13"
set CutCopyMode to false
CopyObject Selection
Activate
set Var2 to the clipboard
end tell

if Var1 Var2 then
display dialog ("Dialog #1")
else
display dialog ("Dialog#2")
end if

The "display dialog" part of the script doesn't get executed. Instead, when I
run this script from Script Editor, the application menu flashes at me. When
I investigate by clicking Script Editor in the application menu, the script
then continues. Can someone fill me in?

Thanks,
Tim Myers




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.