AlistairFrith

Creating & manipulating activeX controls programatically

Discussion created by AlistairFrith on Mar 17, 2009
Latest reply on Mar 17, 2009 by RJKSolutions

I want to programatically create a table of data in Processbook, that can then be sorted by clicking on the header fields. I think that using an MSFlexGrid ActiveX control would be the easiest way but I cannot see how to programatically create one. Here is the sort of thing I want to do:

 

Sub BuildGridSection(srv As Server, SectionModule As PIModule)
    Dim ctrl As PBControl
    Dim grid As MSFlexGrid
   
    Set ctrl = Application.ActiveDisplay.Symbols.Add(pbSymbolControl) '<-- this gives error 8004207E - Requested server not found

    ' how do I make the control into an MSFlexGrid control?
End Sub

 

As you can see, I fail to create a PBControl symbol and even if I had suceeded I do not know how to convert it into an MSFlexGrid. Should I do Set grid = New MSFlexGrid first and then add it to the display (and how do I do that?).

 

Basically, how can I create and manipulate ActiveX controls programatically within Processbook VBA?

 

--- Alistair.

Outcomes