Refer VB-6 : Creating OLE at Design time also.This code links or embeds the complete file.
In case, a part of the file is to be used as an object, the steps involved are as follows:
In case, a part of the file is to be used as an object, the steps involved are as follows:
Here we need two command buttons ,and one OLE ( Once the OLE box has appeared,click CANCEL to remove this dialog box)
A) Property :
Command button : NAME- Command1 , CAPTION- Use OLE Command button : NAME- Command2 , CAPTION- Exit OLE : NAME-OLE1 |
B) Attaching Code to the Object :
Private Sub Command1_Click() If OLE1.PasteOK = True Then OLE1.PasteSpecialDlg End If If OLE1.OLEType = 3 Then MsgBox "Nothing has been copied" End If End Sub Private Sub Command2_Click() End End Sub |