Consulting

Results 1 to 4 of 4

Thread: extract embedded excel objects from word

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    extract embedded excel objects from word

    Hi all

    I need some help in extracting embedded excel objects from a word document to a seperate folder.
    I have recorded a macro which works fine upto opening the document but i am unable to save the document

    please help me

    Thanks,
    Sampth

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    We need more detail. I for one don't understand what you are trying to do.

    It might also help to post the code you are working with.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    hi

    This is my code
    [VBA]
    Sub excelout()

    Dim Ishape As InlineShape, Wdoc As Document

    For Each Ishape In ActiveDocument.InlineShapes
    With Ishape
    If .OLEFormat.ClassType = "Excel.Sheet.8" Then
    .OLEFormat.DoVerb VerbIndex:=1 '.Activate does work too but I wouldn't use it
    Set Wdoc = ActiveDocument

    End If
    End With
    Next Ishape
    End Sub
    [/VBA]

    The problem is embedded excel document is opened but i am unable to save the opened excel

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    I am not following. You use Set Wdoc...but then never use it.

    You can not save the opened Excel unless you have an Excel object instance to work with. Which you do not.

    Please try and be clear when you ask things.

    "I have recorded a macro which works fine upto opening the document but i am unable to save the document "

    Document? A Word file is a document...an Excel file is NOT a document. What you are asking - I think - in the above quote is " i am unable to save the Excel file"...not document. True, you do state it better in your last post - "but i am unable to save the opened excel".

    Using DoVerb will open Excel, but it does NOT create a VBA exposed instance of Excel. Make a real instance, then action it.

    But it would be much easier if you stated things clear in the first place.

Posting Permissions

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