How to modify embedded MS Office document

Say you have a Bound Object Frame on your form, bound to OLE Object field type. User has inserted a MS Office document there, for example Excel Sheet, and you want to modify it contents. The trick is that you have to activate field first, using Action property, and then modify its content. Here a code from sample procedure:
Private Sub cmdModifyExcel_Click()
Dim oSheet As Object
Me.oleExcelObj.Action = acOLEActivate
Set oSheet = Me.oleExcelObj.Object.Sheets(1)
oSheet.Cells(1, 1).Value = "Hi from VBA!"
Me.oleExcelObj.Action = acOLEClose
Set oSheet = Nothing
End Sub



2 Comments:
employee books what about it..employee books Here it is now its up to you...
Nice and knowledgeable gifts for everyone-
booksshelf
books
knowledge
Book and Reference
kitaben
liberary
books
Post a Comment
Links to this post:
Create a Link
<< Home