typecasting in VBA

W

wm

Hi,

I am using VBA to do the following

Dim gc As GridControl
Dim gv As GridView
Set gc = GUIObject.Object
Set gv = gc.MainView

Basically, in the last line of the code above, gc.MainView returns an
object of type BaseView (GridView is derived from BaseView). This would
work in VB, but it does not work in VBA because it is failing to cast
BaseView (which is the return value of gc.MainView) to GridView (which
is the type of gc).

Is there a way in VBA to explicitly cast BaseView to GridView so that
the piece of code above would work?

Thanks a lot for you input.
 

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