ActiveX Allowed or Not

Posted on 2005-05-10
Last Modified: 2007-12-19
I have a control that uses activeX, but is not completely activeX. dont ask how just believe me.

I want to be able to determine if the user has disabled activeX so i can prevent my control from running.

if activeX is disabled or dis-allowed then the control will start its job and not finish, so i would rather just not start it.

does anyone know of a way to check this?
Question by:Joshua Sprague
    LVL 9

    Accepted Solution

    I found this here:

    <script language=vbscript>
        function checkActiveX()
            dim myDict

            on error resume next

            set myDict = CreateObject("Scripting.Dictionary")

            myDict.Add "test", "test"

            if Err.number > 0 then
                gErrorNo = Err.number
                checkActiveX = false
            else // succeeded
                set myDict = nothing
                checkActiveX = true
            end if
        end function


    Author Comment

    by:Joshua Sprague
    i tested the page that you found it on, and that is EXACTLY what i want. unfortunately, the pages i need it on are in C#. could you please tell me how to do this in c#?
    new point value is : 100

    thank you
    LVL 9

    Expert Comment

    I'm sorry but I don't know C#, but I'll bet somone here does:

    You could either open a new question in that area or create a pointer question that links to this question and hope that someone from that area comes over to help.  Or, keep this thread open for a while and maybe someone else will see this question who can help convert it.

    Author Comment

    by:Joshua Sprague
    thanx, i figured it out. i based my code on what you showed me.
    i used vbscript / javascript.
    here is what i did.

    VBScript Function:

    ' Function ActiveXEnabled
    function activexenabled()
      on error resume next
      activex = (NOT IsNull(CreateObject("ScriptBridge.ScriptBridge")))
      activex2 = (NOT IsNull(CreateObject("MSComctlLib.Slider")))
      activex3 = (NOT IsNull(CreateObject("ScriptBridge.ScriptBridge.1")))
      if (activex OR activex2 OR activex3) then
          activexenabled = true
          activexenabled = false
      end if
    end function

    I used javascript to call the function and test for ActiveX being enabled / disabled.

    If it was disabled, i used the javascript     document.writeln     to comment out the ActiveX control.

    works perfectly.

    thank you.
    LVL 9

    Expert Comment

    Cool.  That looks like a nice adaptation.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    731 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

    18 Experts available now in Live!

    Get 1:1 Help Now