Consulting

Results 1 to 2 of 2

Thread: Sleeper: Insert Object

  1. #1

    Sleeper: Insert Object

    Can a object be inserted into a userform?

    I have an object
    =Embed("PersonalCommunications.4.2","")
    on a sheet. I would like to put this on a userform.


    Thanks,


    Kurt

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Kurt,

    Well it depends on what you wish to do with the embeded object?

    If you just want to show it you could use a Webbrowser control instead and have it load your document.

    So put a webbrowser control on a userform and put code in it like this: (to test put the
    PersonalCommunications.xls to download into the same directory as test document)

    Private Sub UserForm_Initialize()
    Dim sFile As String
    sFile = ThisWorkbook.Path & Application.PathSeparator & "PersonalCommunications.xls"
    Me.WebBrowser1.Navigate (sFile)
    End Sub


    If you want it to be editable to retain changes made in the userform you will need a Ole Container Control. Downfall: Excel doesn't have such a control (Access does) so that is no option I think.

    Try the Webcontrol (Toolbox/Right click/More Controls/Microsoft Web browser)

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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