Yikes, , . , Excel ( , ).
-, Excel (Project- > References Microsoft Library Object Library). bona-fide Excel , "" . , , Intellisense .
, .OleFormat.Edit. ( .OleFormat.Activate, .Edit, , ).
.Activate(, ,.Edit), OleFormat.Object. Excel, "" Excel, :
Dim oOleFormat as OleFormat
Set oOleFormat = ...
oOleFormat.Activate
Dim oWorkbook As Excel.Workbook
Set oWorkbook = oOleFormat.Object
' Do stuff with the workbook
oWorkbook.Charts(1).ChartArea.Font.Bold = True
, Excel, - Word "" , , , . , , .
, . tell Word, - , . , , , , . , :
oOleFormat.ActivateAs "This.Class.Does.Not.Exist"
, , , On Error Resume Next. , . :
Private Sub DeactivateOleObject(ByRef oOleFormat as OleFormat)
On Error Resume Next
oOleFormat.ActivateAs "This.Class.Does.Not.Exist"
End Sub
, .
Gary