XLM - some functions do nothing when used via defined name?

P

philkime

I am having to write some macros in the older XLM language (because I
need this to work also on Excel 2008 for Mac which now has no VBA and
you can't do Excel UDFs in Applescript). Everything is fine except for
one thing:

I have a defined-name macro which calls =ALERT() to open a pop-up. It
never appears, however. If I call this line directly as a macro, it
does appear. Is there some reason why perhaps defined-name XLM UDFs
can't pop-up ALERTS? In fact, many things like SELECT, FONT.PROPERTIES
etc. don't work in my macros when I call then via a name?

PK
 
N

Niek Otten

UDFs, when called from a worksheet, directly or indirectly, can not change
anything in the Excel environment. They can only return a value to repace
their call in a formula.
The *can* change the Excel environment when the original call is from VBA
instead of a worksheet. No need to try via another UDF; indirect calls from
worksheets are blocked from changing too.
 
P

philkime

UDFs, when called from a worksheet, directly or indirectly, can not change
anything in the Excel environment. They can only return a value to repace
their call in a formula.
The *can* change the Excel environment when the original call is from VBA
instead of a worksheet. No need to try via another UDF; indirect calls from
worksheets are blocked from changing too.

Groan, I thought that might be the case, thanks. Bit of a problem in
Office 2008 for Mac since there is no VBA and you can't do UDFs via
Applescript.

PK
 
N

Niek Otten

< you can't do UDFs via Applescript>

I think you can:
http://www.microsoft.com/mac/develo...82bc09f9-1ac3-47de-af86-faabd781aae01033&ep=7

But I don't know from my own experience; don't have a Mac

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


UDFs, when called from a worksheet, directly or indirectly, can not change
anything in the Excel environment. They can only return a value to repace
their call in a formula.
The *can* change the Excel environment when the original call is from VBA
instead of a worksheet. No need to try via another UDF; indirect calls
from
worksheets are blocked from changing too.

Groan, I thought that might be the case, thanks. Bit of a problem in
Office 2008 for Mac since there is no VBA and you can't do UDFs via
Applescript.

PK
 
P

philkime

< you can't do UDFs via Applescript>

I think you can:http://www.microsoft.com/mac/developers/default.mspx?CTT=PageView&clr...

But I don't know from my own experience; don't have a Mac

I had a look at this a few weeks ago and the general consensus was
that it was impossible - Applescript is more for controlling things
from the OS and isn't really "in" Office so that you could use it as
an internal UDF. Also, for me, it's nicer to use XLM since in such
case, the spreadsheet will work on any version of Excel on Mac or
Windows. I found a workaround using conditional formatting so it's ok
now. Thanks for the information - it's nice to know something is
impossible sometimes ...
 
H

Héctor Miguel

hi, !
... it's nice to know something is impossible sometimes ...

have you tried using the (ancient ?) xl-4 macro-functions within a macrosheet
(or international macrosheet) in your workbook/s (instead vba coding) ?

certainly, you need to recall (or learn) the xl-4 macros language (xlm)

if any doubts (or further information)... would you please comment ?
hth,
hector.
 

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