How to use MS Flex Grid in Excel vba form

Discussion in 'Microsoft Excel Programming' started by Mika, Nov 3, 2010.

  1. Mika

    Mika Guest

    Hi guys

    I have VB 6, and need to use the Ms Flex Grid control on a VBA form
    within Excel.

    However the incorporation of the control into the form is rejected
    with the message "unsafe..." which normally occurs if you dont have
    the license for it (or don't have VB 6 installed) which is not my
    case.

    In the forms in VB 6 environment, I don't have any problem.

    Does anybody know how to use (load) the cotrol on the Excel form?
     
    Mika, Nov 3, 2010
    #1
    1. Advertisements

  2. Mika

    GS Guest

    Mika was thinking very hard :
    > Hi guys
    >
    > I have VB 6, and need to use the Ms Flex Grid control on a VBA form
    > within Excel.
    >
    > However the incorporation of the control into the form is rejected
    > with the message "unsafe..." which normally occurs if you dont have
    > the license for it (or don't have VB 6 installed) which is not my
    > case.
    >
    > In the forms in VB 6 environment, I don't have any problem.
    >
    > Does anybody know how to use (load) the cotrol on the Excel form?


    When the userform is active in design view, right-click the Toolbox and
    you'll be able to add additional controls. It will, of course, be
    necessary to distribute (and register) the control with your vba
    project in order for it to work on other machines.

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    ClassicVB Users Regroup! comp.lang.basic.visual.misc
     
    GS, Nov 3, 2010
    #2
    1. Advertisements

  3. Mika

    Mika Guest

    On Nov 3, 5:59 pm, GS <> wrote:
    > Mika was thinking very hard :
    >
    > > Hi guys

    >
    > > I have VB 6, and need to use the Ms Flex Grid control on a VBA form
    > > within Excel.

    >
    > > However the incorporation of the control into the form is rejected
    > > with the message "unsafe..." which normally occurs if you dont have
    > > the license for it (or don't have VB 6 installed) which is not my
    > > case.

    >
    > > In the forms in VB 6 environment, I don't have any problem.

    >
    > > Does anybody know how to use (load) the cotrol on the Excel form?

    >
    > When the userform is active in design view, right-click the Toolbox and
    > you'll be able to add additional controls. It will, of course, be
    > necessary to distribute (and register) the control with your vba
    > project in order for it to work on other machines.
    >
    > --
    > Garry
    >
    > Free usenet access athttp://www.eternal-september.org
    > ClassicVB Users Regroup! comp.lang.basic.visual.misc


    GS, I didn't explain it clearly.
    There is not problem to add the control to the toolbox as you
    describe. The error appears when I try to put such control FROM the
    toolbox into the Form. Then, it is not accepted.
     
    Mika, Nov 3, 2010
    #3
  4. Mika

    GS Guest

    It happens that Mika formulated :
    > On Nov 3, 5:59 pm, GS <> wrote:
    >> Mika was thinking very hard :
    >>
    >>> Hi guys

    >>
    >>> I have VB 6, and need to use the Ms Flex Grid control on a VBA form
    >>> within Excel.

    >>
    >>> However the incorporation of the control into the form is rejected
    >>> with the message "unsafe..." which normally occurs if you dont have
    >>> the license for it (or don't have VB 6 installed) which is not my
    >>> case.

    >>
    >>> In the forms in VB 6 environment, I don't have any problem.
    >>> Does anybody know how to use (load) the cotrol on the Excel form?

    >>
    >> When the userform is active in design view, right-click the Toolbox and
    >> you'll be able to add additional controls. It will, of course, be
    >> necessary to distribute (and register) the control with your vba
    >> project in order for it to work on other machines.
    >>
    >> --
    >> Garry
    >>
    >> Free usenet access athttp://www.eternal-september.org
    >> ClassicVB Users Regroup! comp.lang.basic.visual.misc

    >
    > GS, I didn't explain it clearly.
    > There is not problem to add the control to the toolbox as you
    > describe. The error appears when I try to put such control FROM the
    > toolbox into the Form. Then, it is not accepted.


    I see. I don't get that when I draw the control on a userform (or
    drag/drop it there). It seems to work just fine for me. Maybe you could
    provide more info like which version of Excel you're working in and the
    version of MSFlexGrid.ocx you're trying to use.

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    ClassicVB Users Regroup! comp.lang.basic.visual.misc
     
    GS, Nov 3, 2010
    #4
  5. Mika

    Mika Guest

    On Nov 3, 9:15 pm, "Harald Staff" <> wrote:
    > "Mika" <> wrote in message
    >
    > news:...
    >
    > > > I have VB 6, and need to use the Ms Flex Grid control on a VBA form
    > > > within Excel.

    >
    > > > However the incorporation of the control into the form is rejected
    > > > with the message "unsafe..." which normally occurs if you dont have
    > > > the license for it (or don't have VB 6 installed) which is not my
    > > > case.

    >
    > > > In the forms in VB 6 environment, I don't have any problem.

    >
    > Hi Mika
    >
    > Userforms are not compiled like exe files are. To use a control on a
    > userform, the user needs a license to run the control in "design mode" -here
    > meaning a valid Visual Studio 6 installation.
    >
    > So in short, you can't do this.
    >
    > Best wishes Harald



    Just for the records, in case somebody got the same problem, I was
    able to solve it in the most unusual way:

    - First: yes, I do have a legal version of VB 6 installed, and as I
    said I can work in VB and the Flex grid without problem.

    I found that in another excel form my Common dialog control stopped
    working as well, getting the error; "Class not registered...", on top
    of that, another control used: Tree list, had the same error.

    Therefore I re-registered both controls, with regserv32, and voila !
    the MS FlexGrid began to work! I didn't have to register the MS
    FlexGrid control.

    What is the reason ?. I have no clue.
     
    Mika, Nov 4, 2010
    #5
  6. Mika

    Harald Staff Guest

    "Mika" <> skrev i melding
    news:...
    > Just for the records, in case somebody got the same problem, I was
    > able to solve it in the most unusual way:


    > - First: yes, I do have a legal version of VB 6 installed, and as I
    > said I can work in VB and the Flex grid without problem.


    Ah good. For the records, sorry I misunderstood your problem. It usually is:
    A userform like that will not run on other computers that doesn't have VB6,
    even when the controls are properly installed and registered.

    Best wishes Harald
     
    Harald Staff, Nov 4, 2010
    #6
  7. Mika

    GS Guest

    Harald Staff formulated the question :
    > "Mika" <> skrev i melding
    > news:...
    >> Just for the records, in case somebody got the same problem, I was
    >> able to solve it in the most unusual way:

    >
    >> - First: yes, I do have a legal version of VB 6 installed, and as I
    >> said I can work in VB and the Flex grid without problem.

    >
    > Ah good. For the records, sorry I misunderstood your problem. It usually is:
    > A userform like that will not run on other computers that doesn't have VB6,
    > even when the controls are properly installed and registered.
    >
    > Best wishes Harald


    Sorry Harald, but I disagree! Also for the record, I use VB6 controls
    quite a lot in Excel VBA projects and they run without problem on any
    machine I install the project to. Seems they only require being
    registered on the target machine (regardless of where they're installed
    on that machine). I can't speak for all VB6 controls used in MSO VBA
    projects, but the ones I use most often are:

    comctl32.ocx
    comdlg32.ocx
    msflxgrd.ocx
    mshflxgd.ocx
    dbgrid32.ocx
    tabctl32.ocx

    ...all of which work just fine.

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    ClassicVB Users Regroup! comp.lang.basic.visual.misc
     
    GS, Nov 4, 2010
    #7
  8. Mika

    GS Guest

    Harald Staff has brought this to us :
    > "GS" <> wrote in message
    > news:iaut5r$ir0$-september.org...
    >> Sorry Harald, but I disagree!

    >
    > No problem, I'd love to be wrong here.
    > VB6 is seriously obsolete. It's either like I always was wrong, or the
    > licensing problem went away when VB6 support died. Or maybe just different
    > combinations of versions of things behave different.
    >
    > Best wishes Harald


    I can say that I have had problems in the past with different versions
    of these controls, in different versions of Excel. Seems I have been
    able to (over time) come up with the right versions to use in my VBA
    projects. Now that I primarily use VB6 COMAddins, my Excel projects are
    now pure VB6. This, of course, is not always the case since some
    clients specify their solutions be VBA.

    Knd regards,

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    ClassicVB Users Regroup! comp.lang.basic.visual.misc
     
    GS, Nov 4, 2010
    #8
  9. Mika

    Bill in Las Vegas

    Joined:
    Jan 11, 2017
    Messages:
    1
    Likes Received:
    0
    Do I have to have Visual Studio installed, or can I just make FlexGrid available in VBA in Excel by downloading it and registering it in syswow64? Is anyone using it that way? And, if so, does it keep the component in the spreadsheet, or would I have do do the download/register for any user's machine? Sorry to be so ignorant about this...
     
    Bill in Las Vegas, Jan 11, 2017
    #9
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D

    Excel Grid to Template/Form?

    D, Aug 2, 2004, in forum: Microsoft Excel Programming
    Replies:
    3
    Views:
    305
    Tom Ogilvy
    Aug 2, 2004
  2. franck

    VBA excel + Forms : Vlookup on database by form / VBA excel +

    franck, Oct 15, 2004, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    1,349
    Dick Kusleika
    Oct 16, 2004
  3. Nick Hebb

    Snap to grid in VBA (actually a SendKeys question)

    Nick Hebb, Jun 5, 2006, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    1,198
    Nick Hebb
    Jun 6, 2006
  4. Guest

    Flex Grid Control (supporting files)

    Guest, Aug 14, 2006, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    1,269
    NickHK
    Aug 15, 2006
  5. Edward Ulle

    Simple flex grid

    Edward Ulle, Sep 18, 2006, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    725
    Edward Ulle
    Sep 18, 2006
  6. ecm1185

    Excel VBA Data Grid - Changing Column Width

    ecm1185, Feb 27, 2007, in forum: Microsoft Excel Programming
    Replies:
    3
    Views:
    1,260
    Guest
    Feb 27, 2007
  7. scutzer

    How do you add data entry grid to a form(UserForm) in Excel 2003?

    scutzer, Feb 2, 2010, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    652
    JLGWhiz
    Feb 2, 2010
  8. ........

    Why you should change your vehicle to flex fuel

    ........, Nov 7, 2010, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    299
    ........
    Nov 7, 2010
Loading...