+ Reply to Thread
Results 1 to 12 of 12

[SOLVED] Help with using an activex control

  1. #1
    CrazyPhilll
    Guest

    [SOLVED] Help with using an activex control

    Hello,
    I am trying to use the Microsoft communications control 6.0
    (MSCOMM32.ocx).
    To use it under VBA in Excel i have to create the ActiveX module
    somehow.
    I neeed to create the object in my worksheet first so that i can double
    click it and write the code in VBA.
    It seems that this should be as easy as dragging and dropping a
    commandbutton. However when I select the "Microsoft communications
    control 6.0" under the "more Control Elements" button i get an error
    message saying "object could not be created". I get this same message
    for some but not all of the other activex controlls too. (desperately
    tryign to create all kinds of elements hoping to find a solution)

    I know there is an easy 30 sec way to do this but i am stuck in my
    ways. Please help!
    Goodnight (2.30am)


  2. #2
    Tom Ogilvy
    Guest

    RE: Help with using an activex control

    Try putting it on a userform.

    --
    Regards,
    Tom Ogilvy


    "CrazyPhilll" wrote:

    > Hello,
    > I am trying to use the Microsoft communications control 6.0
    > (MSCOMM32.ocx).
    > To use it under VBA in Excel i have to create the ActiveX module
    > somehow.
    > I neeed to create the object in my worksheet first so that i can double
    > click it and write the code in VBA.
    > It seems that this should be as easy as dragging and dropping a
    > commandbutton. However when I select the "Microsoft communications
    > control 6.0" under the "more Control Elements" button i get an error
    > message saying "object could not be created". I get this same message
    > for some but not all of the other activex controlls too. (desperately
    > tryign to create all kinds of elements hoping to find a solution)
    >
    > I know there is an easy 30 sec way to do this but i am stuck in my
    > ways. Please help!
    > Goodnight (2.30am)
    >
    >


  3. #3
    Peter T
    Guest

    Re: Help with using an activex control

    Good morning,

    Somewhat to my surprise I found I could add that control to a worksheet.
    Clicked the more controls on the control Toolbox menu, found it and it went
    straight on. But not onto the toolbar and only after a couple of attempts.

    Doubled clicked the already selected phone icon object and it popped this
    into the sheet module

    Private Sub MSComm1_OnComm()
    End Sub

    Other events are GotFocus & LostFocus.

    I wouldn't know what to do with it though, but in another sub in the
    worksheet module I did this

    Dim m As MSComm
    Set m = MSComm1
    Stop ' alt-v s

    seems to be plenty there in the Locals window.

    When I exit/enter design mode the object becomes invisible/visible.

    Regards,
    Peter T

    "CrazyPhilll" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    > I am trying to use the Microsoft communications control 6.0
    > (MSCOMM32.ocx).
    > To use it under VBA in Excel i have to create the ActiveX module
    > somehow.
    > I neeed to create the object in my worksheet first so that i can double
    > click it and write the code in VBA.
    > It seems that this should be as easy as dragging and dropping a
    > commandbutton. However when I select the "Microsoft communications
    > control 6.0" under the "more Control Elements" button i get an error
    > message saying "object could not be created". I get this same message
    > for some but not all of the other activex controlls too. (desperately
    > tryign to create all kinds of elements hoping to find a solution)
    >
    > I know there is an easy 30 sec way to do this but i am stuck in my
    > ways. Please help!
    > Goodnight (2.30am)
    >




  4. #4
    CrazyPhilll
    Guest

    Re: Help with using an activex control

    Peter T : that is exactly the part that doesnt work .... I clicked the
    more controls on the control toolbar and selected it. Then when
    clicking onto the worksheet the error message pops: "Cannot insert
    object"
    what to do?


  5. #5
    Peter T
    Guest

    Re: Help with using an activex control

    Don't know!
    Just tried again no problem. Having selected it in the list need to "draw"
    it onto the sheet - did you try that.

    Long shot, try adding the ref in Tools References first
    Microsoft Comm Control 6.0

    I didn't need to do that, it got added automatically.

    If stuck I can send to a workbook with the control embedded on a sheet, but
    don't ask me what to do with it !

    Regards,
    Peter T

    "CrazyPhilll" <[email protected]> wrote in message
    news:[email protected]...
    > Peter T : that is exactly the part that doesnt work .... I clicked the
    > more controls on the control toolbar and selected it. Then when
    > clicking onto the worksheet the error message pops: "Cannot insert
    > object"
    > what to do?
    >




  6. #6
    CrazyPhilll
    Guest

    Re: Help with using an activex control

    Peter T:
    yeah, the cursor changes to a little crosshair and i can draw a box
    ..... once i release the left or right mousbutton (wichever i draw the
    box with) the error message mentioned above pops up.
    Microsoft Comm Control 6.0 is already added under references in VBA.


  7. #7
    Peter T
    Guest

    Re: Help with using an activex control

    As you can set the reference can you add it with code

    Sub test()
    'this in a sheet module hence "Me"
    Dim oleObj As OLEObject
    Dim m As MSComm

    Me.OLEObjects.Add ("MSCOMMLib.MSComm.1")
    Set oleObj = Me.OLEObjects(1)
    Set m = oleObj.Object

    Debug.Print oleObj.Name ' MSComm1
    Debug.Print m.ProgId ' MSCOMMLib.MSComm.1
    End Sub

    Regards,
    Peter T


    "CrazyPhilll" <[email protected]> wrote in message
    news:[email protected]...
    > Peter T:
    > yeah, the cursor changes to a little crosshair and i can draw a box
    > .... once i release the left or right mousbutton (wichever i draw the
    > box with) the error message mentioned above pops up.
    > Microsoft Comm Control 6.0 is already added under references in VBA.
    >




  8. #8
    CrazyPhilll
    Guest

    Re: Help with using an activex control

    thanks for the effort ........ runtime error 1004. Can not insert
    Object ........
    Ok, i am about to give up. To bad i can not. Could you send me a sheet
    with one inserted? that would make my day !


  9. #9
    Peter T
    Guest

    Re: Help with using an activex control

    I sent you a workbook with an MSComm embedded in Sheet1

    According to this article
    http://www.tek-tips.com/faqs.cfm?fid=6191

    can only use the MSComm on a form (as Tom originally suggested).

    It looks OK though for me on a sheet, but I've done nothing with it.

    The thought occurred to me that some ActiveX controls are marked unsafe in
    later Windows OS (eg Rich Text Box) and that perhaps that's why you can't
    get it. But in a quick search I didn't find any reference to that effect,
    but maybe double check.

    Regards,
    Peter T

    "CrazyPhilll" <[email protected]> wrote in message
    news:[email protected]...
    > thanks for the effort ........ runtime error 1004. Can not insert
    > Object ........
    > Ok, i am about to give up. To bad i can not. Could you send me a sheet
    > with one inserted? that would make my day !
    >




  10. #10
    Registered User Ivan F Moala's Avatar
    Join Date
    10-25-2003
    Location
    Auckland, New Zealand
    Posts
    71
    That ActiveX control needs to be properly Licenced, so if you have Classic VB6 then it would be licenced and you would have a registration entry under;

    HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905

    and

    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905

    You will find similar contols in VBA that are in VB6 that require this.
    Kind Regards,
    Ivan F Moala From the City of Sails
    \1

  11. #11
    Peter T
    Guest

    Re: Help with using an activex control

    Hi Ivan,

    Indeed I have vb6 and that License. Not sure about the OP (Phil), but he had
    earlier said he was able to set a reference to the control, just couldn't
    add the actual control.

    I sent Phil a wb with the control embedded on a sheet but otherwise empty.
    He returned it to me with a small working demo.

    Regards,
    Peter T

    "Ivan F Moala" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > That ActiveX control needs to be properly Licenced, so if you have
    > Classic VB6 then it would be licenced and you would have a registration
    > entry under;
    >
    > HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905
    >
    > and
    >
    >

    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C
    00905
    >
    > You will find similar contols in VBA that are in VB6 that require this.
    >
    >
    > --
    > Ivan F Moala
    >
    >
    > ------------------------------------------------------------------------
    > Ivan F Moala's Profile:

    http://www.excelforum.com/member.php...fo&userid=1954
    > View this thread: http://www.excelforum.com/showthread...hreadid=534898
    >




  12. #12
    Registered User
    Join Date
    07-18-2005
    Posts
    16

    Old news, but still...

    Just in case anyone could use this info:

    You have to use a Userform!

    Anyway I couldn't make it work without it. In fact I used a lot of time trying to make it work on a sheet with no luck. As far as I know you don't have to show the userform...

    Greiffenberg

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1