How to create OLE Objects at run time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shuvo2k6
    New Member
    • Jan 2008
    • 68

    How to create OLE Objects at run time

    How to create OLE Objects at run time, anyone give me the code solution
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by shuvo2k6
    How to create OLE Objects at run time, anyone give me the code solution
    do you mean creating the Control? (like controls.add("v b...))
    or embeding an application to your ole object?

    Comment

    • shuvo2k6
      New Member
      • Jan 2008
      • 68

      #3
      Originally posted by kadghar
      do you mean creating the Control? (like controls.add("v b...))
      or embeding an application to your ole object?
      OLE as an Object and that can embed any application

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        Originally posted by shuvo2k6
        OLE as an Object and that can embed any application
        you can create any object, declare it as a variable, then just embed any of those objects to the Control

        e.g.

        [CODE=vb]dim obj1 as object
        dim obj2 as object
        set obj1 = createobject ("excel.applica tion")
        set obj2 = createobject ("internetexplo rer,application ")
        obj1.visible=tr ue
        obj2.visible=tr ue
        obj1.open("c:\m ybook.xls")
        obj2.navigate "http://bytes.com"[/CODE]

        since you set both as visible = true, they will appear in a new window, but you can embed any of them to your OLE control in your Form.

        HTH

        Comment

        Working...