Consulting

Results 1 to 8 of 8

Thread: Disabling ActiveXControls Prompt

  1. #1

    Disabling ActiveXControls Prompt

    I ve been fighting with this for a while now and cannot get to the bottom of this

    I have used a spreadsheet control on my application (for good reason) and it works smoothly

    The problem is I get the following message: "This application is about to initalise ActiveXControls"

    Has anyone else seen this and is there an easy way to disable this?

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Hi Chloe,
    Sorry but you either need to remove the killbit (http://support.microsoft.com/kb/240797) which can compromise the security of the machine. Or you will need switch to safe control. May I ask what necessitated the need for this control?
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Try the registry hack that I explained in this thread. http://www.vbaexpress.com/forum/showthread.php?t=26942

  4. #4
    Yes quite simply I need a grid to display a ton of data - A multi column list box doesnt look right

    You dont have scrolling and you also dont have grid lines.

    My only option was a spreadsheet control.....

    What would you have done? Any ideas?

  5. #5
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    I would switch over to the Microsoft List View Control. This is still considered a safe control and had a lot more power than a listbox. If you need help with that, I would be happy to assist.
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  6. #6
    Can you provide an example of the istview control in action - I just played around with it and I see two things:
    1) I still get prompted about Active X Controls.
    2) There is no easy way to set gridlines....

    Any help much appreciated.

  7. #7
    Oorang - Can you show me how to do this please?

  8. #8
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    To use just create a userform and throw a listview in it.
    [vba]Option Explicit
    Private Sub UserForm_Initialize()
    Dim lv As MSComctlLib.ListView
    'Set up listview:
    'If in Access:
    'Set lv = Me.ListView1.Object
    'If in anything else:
    Set lv = Me.ListView1
    ConfigureListView lv
    LoadWorksheetIntoListView Sheet1, lv
    End Sub
    Private Sub ConfigureListView(ByVal lv As MSComctlLib.ListView)
    lv.View = lvwReport
    lv.Gridlines = True '<------
    End Sub
    Private Sub LoadWorksheetIntoListView(ByVal ws As Excel.Worksheet, ByVal lv As _
    MSComctlLib.ListView)
    Dim cll As Excel.Range
    Dim li As MSComctlLib.ListItem
    Dim lsi As MSComctlLib.ListSubItem
    Dim lngColLeft As Long
    Dim lngColTwo As Long
    Dim lngColRight As Long
    Dim lngCol As Long
    Dim lngRowTop As Long
    Dim lngRowBottom As Long
    Dim lngRow As Long
    Dim blnColor As Boolean
    'Get headers
    lngRowTop = ws.UsedRange.Row
    For Each cll In Intersect(ws.UsedRange, ws.Rows(lngRowTop))
    lv.ColumnHeaders.Add Text:=cll.Value
    Next
    lngRowBottom = ws.UsedRange.Rows.Count + lngRowTop - 1&
    'Load data:
    lngColLeft = ws.UsedRange.Column
    lngColRight = ws.UsedRange.Columns.Count + lngColLeft - 1&
    lngColTwo = lngColLeft + 1&
    For lngRow = lngRowTop + 1& To lngRowBottom
    Set li = lv.ListItems.Add(Text:=ws.Cells(lngRow, lngColLeft))
    If blnColor Then li.ForeColor = &HA083A0
    For lngCol = lngColTwo To lngColRight
    Set lsi = li.ListSubItems.Add(Text:=ws.Cells(lngRow, lngCol))
    If blnColor Then lsi.ForeColor = &HA083A0
    Next
    blnColor = Not blnColor
    Next
    End Sub
    [/vba]
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •