I have to assign values to several existing AD-User-Properties, for
example "fen-UM-AllowCoversheetOverride".
As they contain hyphens, I put them in square brackets (view article
http://groups.google.de/group/microsoft.public.scripting.vbscript/browse_th=
read/thread/738be478df9267f8/2fbb6c217bfe9e26?lnk=3Dgst&q=3Dhyphen&rnum=3D1=
#2fbb6c217bfe9e26).

This works fine in VB-Script, but not in VBA (Excel):

objUser.[fen-UM-AllowCoversheetOverride] =3D False

What I get is Runtime-Error 438 "Property or Method not supported"
(the english version could be different, original message in german is
"Objekt unterst=FCtzt diese Eigenschaft oder Methode nicht")

Other properties without hyphens are processed correctly.

Any ideas?

tia
Peter

Re: VBA-Problem with AD-User-Properties containing hyphens by pfe

pfe
Fri Oct 13 03:54:19 CDT 2006

Now my VBA-Script works properly using the put-Method and the
attribute-names enclosed in quotation-marks:

objUser.Put "fen-UM-AllowCoversheetOverride", False

Thanks for thinking about it.
Peter

pfe wrote:
> I have to assign values to several existing AD-User-Properties, for
> example "fen-UM-AllowCoversheetOverride".
> As they contain hyphens, I put them in square brackets (view article
> http://groups.google.de/group/microsoft.public.scripting.vbscript/browse_=
thread/thread/738be478df9267f8/2fbb6c217bfe9e26?lnk=3Dgst&q=3Dhyphen&rnum=
=3D1#2fbb6c217bfe9e26).
>
> This works fine in VB-Script, but not in VBA (Excel):
>
> objUser.[fen-UM-AllowCoversheetOverride] =3D False
>
> What I get is Runtime-Error 438 "Property or Method not supported"
> (the english version could be different, original message in german is
> "Objekt unterst=FCtzt diese Eigenschaft oder Methode nicht")
>
> Other properties without hyphens are processed correctly.
>=20
> Any ideas?
>=20
> tia
> Peter