Consulting

Results 1 to 8 of 8

Thread: Make my own Control

  1. #1

    Make my own Control

    I know how to make my own ActiveX control by using VB.

    Is it possible to make our own forms? or Chart objects? How?

    Net, I would like make a control and link to a range. When the data in that range changes, the control changes accordingly, without to run any code or click anything.

    Thanks in advance!

  2. #2
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by Tiger Chen
    I know how to make my own ActiveX control by using VB.

    Is it possible to make our own forms? or Chart objects? How?
    Hi Tiger,

    If you mean VBA, you can create forms in the VBE window by going to Tools>Insert>Userform

    Quote Originally Posted by Tiger Chen
    Net, I would like make a control and link to a range. When the data in that range changes, the control changes accordingly, without to run any code or click anything.

    Thanks in advance!
    If you have oFFICE 2000 or greater you can access Office Web Components (OWC) and insert spreadsheets, charts etc onto the form - have a look here for a basic example to get you started

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  3. #3
    You know, there are two kinds of controls we can use from Excel Main window: Forms and Control Toolbox.

    For Forms, for example, the listbox. We can set the data sourse and control range.

    What I want is to make something like forms (or Chart,...) by VB. When user use it, don't need any code.

    I know how to use VB make activeX control. We can use it like a build in control after registration.

  4. #4
    Should I give up?

  5. #5
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi Tiger,

    I don't understand exactly what it is that you want to do here...

    Do you want to embed a form on the worksheet? (You can simulate a form by creating a large forms command button and placing other controls on it).

    Do you just want to create a chart programattically?

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  6. #6
    I want to create my own Forms (or chart object) by using VB code. A simple example, how can we create a Listbox (Forms, not ActiveX control)?

    In other word, how Microsoft develop Forms and Chart objects?
    There are should be in a .dll file. But, can it be developed by VB language? How to make a very simple one?

  7. #7
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by Tiger Chen
    I want to create my own Forms (or chart object) by using VB code. A simple example, how can we create a Listbox (Forms, not ActiveX control)?
    Simple example... [vba]
    Option Explicit

    Sub AddListBox()

    ActiveSheet.ListBoxes.Add(170, 25, 190, 180).Select
    With Selection
    .ListFillRange = "$A$1:$A$20"
    .Display3DShading = True
    End With

    End Sub[/vba]record a macro of you performing the actions you want

    Quote Originally Posted by Tiger Chen
    In other word, how Microsoft develop Forms and Chart objects?
    There are should be in a .dll file. But, can it be developed by VB language? How to make a very simple one?
    ?this seems to indicate that you want to develop a stand-alone project in VB and not VBA?
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  8. #8
    Yes, you are getting to my point. Any thoughts?

    Sorry, this may not be the right question I should to ask in VBA forum.

Posting Permissions

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