Consulting

Results 1 to 3 of 3

Thread: Solved: How to save OLE object added in a sheet.

  1. #1
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    2
    Location

    Solved: How to save OLE object added in a sheet.

    Hi All,

    Can anyone please tell how to save the OLE objects added in a sheet.

    Ex.
    In a sheet i have added 100 MS word objects.(Embedded)
    now i want to save all these 100 MS word objects into my d: drive as a word documents.

    Can we write a macro for this.
    i tried a lot but was not able to get the solution.
    Any suggestion would be of great use.

    Thanks in advance.

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Probably not the answer you want, but it is rare that word is embedded into Excel, usually it is the other way around, or you have Word embedded into Access. I have heard that embedding word into Excel only permits you to see the first page. My only guess is that you could open an ADODB.Stream and copy each Word Object to a file. Perhaps you could post a sample, with just a single embedded Word doc. Stan

  3. #3
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    2
    Location

    got the solution

    thanks for reply..
    i got the solution..
    following code can be used...



    Sub save_ole_file()
    Dim wordObj As OLEObject
    Set wordObj = Worksheets("Sheet1").OLEObjects(1)

    wordObj.Activate
    With wordObj.Object.Application.WordBasic
    .FileSaveas "c:\mytempx"
    End With
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •