Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamically loaded ActiveX Control can't be enabled

Posted on 2001-07-25
6
Medium Priority
?
308 Views
Last Modified: 2008-02-01
Hi,

I have an app consisting of a user interface layer, (a series of forms in a standard VB project), a business logic layer, (a series of classes/modules in an ActiveX dll project), and additional user interface controls I have designed myself, (in an ActiveX control project).

The three projects are under development and hence have not been compiled. I am running them as a group project with relevent references defined where necessary.

The ActiveX controls are loaded dynamically at run time, i.e. only when required. (The user accesses one of a number of functions and the relevant screen is loaded as an ActiveX control as a result).

Initially this worked fine but I have done something that prevents the dynamically loaded control from being enabled!!!

The actual code for loading the control hasn't been touched - any clues - is it a project reference/component/properties issue?

Here is the routine for loading the activeX control.

****At top of form code*****
' Used to allow dynamic load of user controls
Private WithEvents FL3IF As VBControlExtender
Private FL3IFX As Object

***Name of user control passed to  routine in format "projectname.controlname"***

Private Sub Showscreen(UC_Name As String)
' -- Load a user control and show it
   
    On Error Resume Next            ' Tidy Up
    FL3IFX.CloseModule
    Me.Controls.Remove "DATA"
    Set FL3IFX = Nothing
    Set FL3IF = Nothing
   
    Set FL3IF = Me.Controls.Add(UC_Name, "DATA")
   
    Set FL3IF.Container = fmeX   ' A frame on main form
 
    With FL3IF
        .Top = 0
        .Left = 0
        .Height = fmeX.Height
        .Width = fmeX.Width
        Set FL3IFX = .object
       
        .Visible = True
        .Enabled = True    ' ****doesn't work!!!!!****
    End With

End Sub


 



 
0
Comment
Question by:G_Evans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Expert Comment

by:vindevogel
ID: 6316683
Suggestion: Remove the ON ERROR RESUME NEXT and see where it goes wrong (it'll go wrong on the remove too, but just skip that during debugging)

The ON ... prevents you from seeing the correct error.  See what comes out of it.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6316768
Does the property enabled exist?

Also try to move only the enabled property outside the with statement.

regards,
CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6316769
What exactly is the error btw?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Accepted Solution

by:
Dave_Greene earned 800 total points
ID: 6316858
Probably a silly question but is "fmeX" - frame enabled?
0
 

Author Comment

by:G_Evans
ID: 6316879
Sorry to waste your time lads, (&/or lasses).

I had somehow set the frame enabled property to 'false'!

I will return to work, tail firmly between legs!!!!!!

(For the record the .enabled property of the FL3IF object was not a supported one, this was being masked by the error handling - cheers!)
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6316886
That was my second question. Glad you got it working...  the frustration is over.. I love it when that happens  :)

Cheers mate!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question