Re: Insert OLE Object Error 2793

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Specterman
    New Member
    • Oct 2006
    • 1

    #1

    Re: Insert OLE Object Error 2793

    Colin Leahey
    Guest
    n/a Posts November 12th, 2005
    01:40 PM
    #3


    Re: Insert Ole Object Error 2793
    --------------------------------------------------------------------------------

    Having looked at the rest of the code in this module I can see the
    problem was me using dodgey coding. The idea was the the user never
    sees the ole control and just clicks on a button to insert or veiw
    objects. So I hid the ole control on the form and didn't let it have
    focus.

    Private Sub oleBlob_GotFocu s()
    cmdActivateOLE. SetFocus
    End Sub


    This was my mistake, the control must have focus in order display the
    Insert object dialog.

    If anyone comes across this an a MDSN article please could you attach
    it as I couldn't find it anywhere and had to work this out for myself.

    Colin.
    Colin, thank you for your posts on this subject. It helped me to solve a similar problem I was having. I'm designing a form that will let the user select an Excel file to embed. It appears that setting the focus IS the key to this problem, however, you have to make sure you set the ".enabled" property of the OLE object to True before setting the focus. I don't want my users to edit the source file, so I have the OLE object disabled and locked at all times except for when the user wants to look at a different file.

    Thanks again!
    Specterman
Working...