Dynamic Object Creation... Possible?
I'm trying to determine if it is possible to dynamically set an object. In
other words, if I have a variable name (say MyCalx), is it possible to pass
that to a subroutine and do a Set MyCalx as New Calendar. It seems to work
when I do this, but cannot access any of the properties or functions using
MyCalx. If I try something like MyCalx.getdate() it comes back with "object
required".
Any help on this would be greatly appreciated.
Jordy
Re: Dynamic Object Creation... Possible?
Use Set MyCalx = Server.CreateObject("<ProgID>") instead of
Set MyCalx as New Calendar. You need the ProgID for the Calendar object.
"Jordan" <jordys@mediaone.net> wrote in message
news:3bc364fe$1@news.devx.com...
>
> I'm trying to determine if it is possible to dynamically set an object.
In
> other words, if I have a variable name (say MyCalx), is it possible to
pass
> that to a subroutine and do a Set MyCalx as New Calendar. It seems to
work
> when I do this, but cannot access any of the properties or functions using
> MyCalx. If I try something like MyCalx.getdate() it comes back with
"object
> required".
>
> Any help on this would be greatly appreciated.
>
> Jordy
Re: Dynamic Object Creation... Possible?
dear friend,
try passing the mycalx object to an object variable in the called function.
ie create an object within the called routine and then pass the mycalx object
regards
venki