Alex & Access

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
My Photo
Name:Alex Dybenko

Location:Moscow, Russia
Google
 
Web AccessBlog.net

Monday, September 05, 2005

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:

Blogger Greg said...

employee books what about it..employee books Here it is now its up to you...

2:38 PM  
Blogger Ayisha said...

Nice and knowledgeable gifts for everyone-
booksshelf
books
knowledge
Book and Reference
kitaben
liberary
books

9:36 AM  

Post a Comment

Links to this post:

Create a Link

<< Home