Can't Get To "AccrIntM" From MS Access

  • Thread starter Thread starter (PeteCresswell)
  • Start date 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?
 
(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.
 
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
 
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.
 
(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.
 
Back
Top