Can't Get To "AccrIntM" From MS Access

  • Thread starter (PeteCresswell)
  • Start date
P

(PeteCresswell)

I'm running into something around some machines having
Excel 11 on them and other machines having Excel 12 on them.

With an Excel 11 machine, no problem.

But on Excel 12 machines, this code (in an MS Access routine)
dies with "1004: Cannot run the macro 'AccrIntM'. The macro may
not be available in this
workbook or all macros may be disabled."
---------------------------------------------------------------------
16080 myResult = gExcelApp.Run("AccrIntM", _
myPaymentDateLast, _
mySettlementDate, _
myCouponRate, _
myParAmount, _
myBasis _
)
---------------------------------------------------------------------

I'm assuming that the message reflects the problem - i.e. no
parms/editing have changed from 11 to 12 and the problem is that
my code isn't getting to "AccrIntM".

My first suspicion was something with MS having disabled macros
by default, but they seem tb enabled when I open up Excel.

Maybe some other little security twist where other applications
can't reach out and touch Excel without some setting?
 
C

Clif McIrvin

(PeteCresswell) said:
I'm running into something around some machines having
Excel 11 on them and other machines having Excel 12 on them.

With an Excel 11 machine, no problem.

But on Excel 12 machines, this code (in an MS Access routine)
dies with "1004: Cannot run the macro 'AccrIntM'. The macro may
not be available in this
workbook or all macros may be disabled."

[ ]

I just tried a little test.

From the Access VBE immediate window:

set xl=createobject("Excel.Application")
?typename(xl)
Application

?xl.name
Microsoft Excel

?xl.version
14.0

?xl.evaluate("MAX(5,3)")
5

?xl.run("Max",5,3)
yields error 1004: with the same error text you report (at least the 2nd
time .... the 1st time I got error 1004: Application defined error - or
something like that.)

not sure what that tells you ... at least it confirms your experience on
another machine.
 
C

Clif McIrvin

Clif McIrvin said:
(PeteCresswell) said:
I'm running into something around some machines having
Excel 11 on them and other machines having Excel 12 on them.

With an Excel 11 machine, no problem.

But on Excel 12 machines, this code (in an MS Access routine)
dies with "1004: Cannot run the macro 'AccrIntM'. The macro may
not be available in this
workbook or all macros may be disabled."

[ ]

I just tried a little test.

From the Access VBE immediate window:

set xl=createobject("Excel.Application")
?typename(xl)
Application

?xl.name
Microsoft Excel

?xl.version
14.0

?xl.evaluate("MAX(5,3)")
5

?xl.run("Max",5,3)
yields error 1004: with the same error text you report (at least the
2nd time .... the 1st time I got error 1004: Application defined
error - or something like that.)

not sure what that tells you ... at least it confirms your experience
on another machine.


I also automate Excel from Access .... but I have had no need (so far)
of using Worksheet functions.

Another thought --

?xl.WorksheetFunction.Min(5,3)
3
 
P

(PeteCresswell)

Per Clif McIrvin:
I also automate Excel from Access .... but I have had no need (so far)
of using Worksheet functions.

Another thought --

?xl.WorksheetFunction.Min(5,3)
3

Good catch!!!!

I'm testing right now, and it looks like Excel 12 supports the
WorksheetFunction.Whatever syntax, but not the Run("Whatever")
syntax.

And it's vice-versa under 11.
 
C

Clif McIrvin

(PeteCresswell) said:
Per Clif McIrvin:

Good catch!!!!

I'm testing right now, and it looks like Excel 12 supports the
WorksheetFunction.Whatever syntax, but not the Run("Whatever")
syntax.

And it's vice-versa under 11.


Ah, "Progress!"

<sigh>

Glad I was able to help.
 
C

Clif McIrvin

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