After registering OCX, how to "tell" VB program to refresh the Control?

Posted on 2006-03-24
Last Modified: 2008-02-01
For example Calendar control using MSCAL.OCX
If I have two version of MSCAL.OCX ie 8.0 and 11.0
Version 11.0 is under
"C:\Program Files\Microsoft Office\OFFICE11\MSCAL.OCX"
Version 8.0 is under

After I do a
regsvr32 /u "C:\Program Files\Microsoft Office\OFFICE11\MSCAL.OCX"
regsvr32 "C:\WINDOWS\system32\MSCAL.OCX"
(To unregister Version 11.0 and register Version 8.0)

Is there a systematic way to "tell" VB program to refresh the Control in order to reflect the updated version?
Question by:william007
    LVL 22

    Accepted Solution

    Not that I know of but if you close your project and reopen it you should get the control that is currently registered.
    LVL 15

    Expert Comment

    You may be able to rename one of them, register it and have both at your disposal.
    LVL 8

    Expert Comment

    by:Leo Eikelman
    Why would you want to do this?  It is basically bad programming.  

    Register all your components before starting the application.

    LVL 3

    Expert Comment

    #1, Close the Visual Studio
    #2. Start your project again
    #3. Go to the Project | Components
    #4. Uncheck the Calendar Control
    #5. Then click BROWSE to select your new MSCAL.OCX
    LVL 8

    Assisted Solution

    by:Leo Eikelman
    or... don't load your dll while the application is open (because it's a bad practice) and just open your application once your dll is loaded and use the newly loaded component.

    LVL 9

    Author Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now