Custom functions in Applescript to replace VBA in OSX Excel 2008?

P

philkime

I have a quick question. I need to port a spreadsheet which uses
custom functions in cells. These functions are written in VBA. I need
to port the whole thing to Applescript but I need to know if this is
even possible before I start. I know one can do most office things
with Applescript but Applescript is an external thing to office,
unlike VBA so I need to known if I can call custom functions written
in Applescript from cells as one can with VBA. I know you can control
Office from Applescript, but I need to call Applescript functions from
cells in a spreadsheet. If this isn't possible, then Excel 2008 is
completely useless to me - can it be done?

PK
 
P

philkime


Thanks - looked at this but it seems to talk only about controlling
office apps from Applscript. I want to do, so to speak, the opposite -
I have a spreadsheet in which many cells call custom functions written
in VBA like

=SomeCustFunction(someRange)

etc. and I have no idea how to "call" applescript implementations of
these functions.

PK
 
J

JE McGimpsey

Thanks - looked at this but it seems to talk only about controlling
office apps from Applscript. I want to do, so to speak, the opposite -
I have a spreadsheet in which many cells call custom functions written
in VBA like

=SomeCustFunction(someRange)

etc. and I have no idea how to "call" applescript implementations of
these functions.

Unfortunately, user functions via AppleScript aren't supported in XL08.

However, it is possible to use the older XL4 Macro language to create
user functions (or to call compiled AppleScripts via =exec(...)). See

http://tinyurl.com/4342nk
 
P

philkime

Unfortunately, user functions via AppleScript aren't supported in XL08.

However, it is possible to use the older XL4 Macro language to create
user functions (or to call compiled AppleScripts via  =exec(...)). See

Groan, thanks. Back to XLM then.

PK
 
L

laurent.e.nguyen

Unfortunately, user functions via AppleScript aren't supported in XL08.

However, it is possible to use the older XL4 Macro language to create
user functions (or to call compiled AppleScripts via  =exec(...)). See

 http://tinyurl.com/4342nk

Excuse me if that's a totally basic question, but I am new to Excel
2008 and I need to do this too. However when I type "=exec()" in a
cell, it complains this is not a valid function?? Do you have to do
something special to make this work?

Thanks
 
B

Bob Greenblatt

Excuse me if that's a totally basic question, but I am new to Excel
2008 and I need to do this too. However when I type "=exec()" in a
cell, it complains this is not a valid function?? Do you have to do
something special to make this work?

Thanks
Typing Exec in a cell will NOT work, as you have discovered. EXEC is a macro
command. You must enter it on an XLM macro sheet. You can add a sheet by
pressing Command-F11. You then need to create a function macro containing
the Exec statement to run your compiled script.
 
J

Jim Eberle

Typing Exec in a cell will NOT work, as you have discovered. EXEC is a macro
command. You must enter it on an XLM macro sheet. You can add a sheet by
pressing Command-F11. You then need to create a function macro containing
the Exec statement to run your compiled script.

Is the REGISTER() function supported in Excel 2008? I've been trying to get
it to call a shared library (both a MachO and a CFM), but neither one works.
The CFM one actually works in Excel X. Is there any information on this
particular integration option? I can't seem to find any info on it.

Thank you,
Jim Eberle
 
B

Bob Greenblatt

On 3/31/09 11:30 PM, in article
(e-mail address removed), "Jim Eberle" <Jim
Is the REGISTER() function supported in Excel 2008? I've been trying to get
it to call a shared library (both a MachO and a CFM), but neither one works.
The CFM one actually works in Excel X. Is there any information on this
particular integration option? I can't seem to find any info on it.

Thank you,
Jim Eberle
Register() in XLM ought to work. But, I have never tried it? Are you sure
the shared library you are trying to use is compatible with the version of
OS you are using? Does Mach0 or CFM say it will work in OSX?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top