Access 2003 - automation Object

G

Guest

I was using this function with Access 2000 and it was working fine; however,
I upgraded to Access 2003 and now it will not work. The Error message is
"The object doesn't contain the Automation object "MaxValueVariantArray."
You tried to run a VB procedure to set a property or method for an object.
However, the component doesn't make the property or method available for
automation operations. Can someone please assist. Thank you

Option Compare Database

Function MaxValueVariantArray(ParamArray ValuesArray() As Variant) As Variant

' ** THIS FUNCTION RETURNS THE MAXIMUM VALUE FROM AN ARRAY OF VALUES.
' Ken Snell 19 May 2005

Dim xlngLB As Long, xlngUB As Long, xlngCnt As Long
Dim xvarTp As Variant
xlngLB = LBound(ValuesArray)
xlngUB = UBound(ValuesArray)
If xlngUB >= 0 And xlngLB >= 0 Then
xvarTp = ValuesArray(xlngLB)
For xlngCnt = xlngLB + 1 To xlngUB
If ValuesArray(xlngCnt) > xvarTp Then xvarTp = ValuesArray(xlngCnt)
Next xlngCnt
End If
MaxValueVariantArray = xvarTp
End Function
 
K

Ken Snell \(MVP\)

Is the function in a regular module in the file? Is the module named
differently than the function name?
 
K

Ken Snell \(MVP\)

On which line of the code does the VBE debugger stop and say there is a
problem?
 
G

Guest

It doesn't , I have it in the module
On my form - i use it to give me the the max value of a set of dates.

ex.
=IIf([this]="that",MaxValueVariantArray([date1]+30,[Date2]+30,[date3]+30,[date4]+30),"")

the forms shows: #name?

This only happened after I installed Access 2003
 
K

Ken Snell \(MVP\)

Try this:

=IIf([this]="that",MaxValueVariantArray(Array([date1]+30,[Date2]+30,[date3]+30,[date4]+30)),"")


--

Ken Snell
<MS ACCESS MVP>



dchristo said:
It doesn't , I have it in the module
On my form - i use it to give me the the max value of a set of dates.

ex.
=IIf([this]="that",MaxValueVariantArray([date1]+30,[Date2]+30,[date3]+30,[date4]+30),"")

the forms shows: #name?

This only happened after I installed Access 2003
Ken Snell (MVP) said:
On which line of the code does the VBE debugger stop and say there is a
problem?
 
G

Guest

I am still getting the same error message "The object doesn't contain the
Automation object "MaxValueVariantArray."

Ken Snell (MVP) said:
Try this:

=IIf([this]="that",MaxValueVariantArray(Array([date1]+30,[Date2]+30,[date3]+30,[date4]+30)),"")


--

Ken Snell
<MS ACCESS MVP>



dchristo said:
It doesn't , I have it in the module
On my form - i use it to give me the the max value of a set of dates.

ex.
=IIf([this]="that",MaxValueVariantArray([date1]+30,[Date2]+30,[date3]+30,[date4]+30),"")

the forms shows: #name?

This only happened after I installed Access 2003
Ken Snell (MVP) said:
On which line of the code does the VBE debugger stop and say there is a
problem?

--

Ken Snell
<MS ACCESS MVP>


Good morning

it is Module 1

:

Is the function in a regular module in the file? Is the module named
differently than the function name?

--

Ken Snell
<MS ACCESS MVP>


I was using this function with Access 2000 and it was working fine;
however,
I upgraded to Access 2003 and now it will not work. The Error
message
is
"The object doesn't contain the Automation object
"MaxValueVariantArray."
You tried to run a VB procedure to set a property or method for an
object.
However, the component doesn't make the property or method available
for
automation operations. Can someone please assist. Thank you

Option Compare Database

Function MaxValueVariantArray(ParamArray ValuesArray() As Variant)
As
Variant

' ** THIS FUNCTION RETURNS THE MAXIMUM VALUE FROM AN ARRAY OF
VALUES.
' Ken Snell 19 May 2005

Dim xlngLB As Long, xlngUB As Long, xlngCnt As Long
Dim xvarTp As Variant
xlngLB = LBound(ValuesArray)
xlngUB = UBound(ValuesArray)
If xlngUB >= 0 And xlngLB >= 0 Then
xvarTp = ValuesArray(xlngLB)
For xlngCnt = xlngLB + 1 To xlngUB
If ValuesArray(xlngCnt) > xvarTp Then xvarTp =
ValuesArray(xlngCnt)
Next xlngCnt
End If
MaxValueVariantArray = xvarTp
End Function
 
K

Ken Snell \(MVP\)

Check your References and be sure that none are showing as "MISSING".

--

Ken Snell
<MS ACCESS MVP>


dchristo said:
I am still getting the same error message "The object doesn't contain the
Automation object "MaxValueVariantArray."

Ken Snell (MVP) said:
Try this:

=IIf([this]="that",MaxValueVariantArray(Array([date1]+30,[Date2]+30,[date3]+30,[date4]+30)),"")


--

Ken Snell
<MS ACCESS MVP>



dchristo said:
It doesn't , I have it in the module
On my form - i use it to give me the the max value of a set of dates.

ex.
=IIf([this]="that",MaxValueVariantArray([date1]+30,[Date2]+30,[date3]+30,[date4]+30),"")

the forms shows: #name?

This only happened after I installed Access 2003
:

On which line of the code does the VBE debugger stop and say there is
a
problem?

--

Ken Snell
<MS ACCESS MVP>


Good morning

it is Module 1

:

Is the function in a regular module in the file? Is the module
named
differently than the function name?

--

Ken Snell
<MS ACCESS MVP>


I was using this function with Access 2000 and it was working
fine;
however,
I upgraded to Access 2003 and now it will not work. The Error
message
is
"The object doesn't contain the Automation object
"MaxValueVariantArray."
You tried to run a VB procedure to set a property or method for
an
object.
However, the component doesn't make the property or method
available
for
automation operations. Can someone please assist. Thank you

Option Compare Database

Function MaxValueVariantArray(ParamArray ValuesArray() As
Variant)
As
Variant

' ** THIS FUNCTION RETURNS THE MAXIMUM VALUE FROM AN ARRAY OF
VALUES.
' Ken Snell 19 May 2005

Dim xlngLB As Long, xlngUB As Long, xlngCnt As Long
Dim xvarTp As Variant
xlngLB = LBound(ValuesArray)
xlngUB = UBound(ValuesArray)
If xlngUB >= 0 And xlngLB >= 0 Then
xvarTp = ValuesArray(xlngLB)
For xlngCnt = xlngLB + 1 To xlngUB
If ValuesArray(xlngCnt) > xvarTp Then xvarTp =
ValuesArray(xlngCnt)
Next xlngCnt
End If
MaxValueVariantArray = xvarTp
End Function
 

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