Consulting

Results 1 to 6 of 6

Thread: HELP - Adding InlineShapes Doesn't work on 1 PC. It Works on ALL Other PCs

  1. #1
    VBAX Newbie
    Joined
    Nov 2013
    Posts
    4
    Location

    HELP - Adding InlineShapes Doesn't work on 1 PC. It Works on ALL Other PCs

    Hello all,

    Sorry to jump in with my very first post being this one, but I'm at a loss as to what's going on so I would appreciate some guidance if anyone is willing...

    I have a script that runs perfectly well on everyone's computer in my company except 1 person. For that one person they get the runtime error above (error -2147467259 (80004005)).

    Here what the script should do...

    It should go to the footer. Look for "XXX" and replace it with a small logo.

    Like I said, it works every time on everyone else's computer so I don't think there's anything wrong with the code. I'm wondering if there is something wrong with the user's setup.

    What happens with this user is this (when I step into the code)...

    The code finds the footer, then it adds the logo to the TOP LEFT of the HEADER. Then the error message appears.

    Here's the code...

     
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
      
     
             With Selection.Find
            .Text = "XXX"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
                  
          Do While .Execute
     
     
    Selection.InlineShapes.AddPicture filename:= _
            "\\filepath\pictureName.JPG" _
            , LinkToFile:=False, SaveWithDocument:=True
    Loop
    .Execute
        End With
    However, if I change the inlineshapes line to...

     
    selection.typetext text:= "Hello"
    It works fine.

    Does anyone have any suggestions on what is going on?

    Many thanks in advance.

    Andre

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Does the user with the errant PC have access to the folder where the images are stored?
    Have you tried repairing the Office installation on the affected PC (via Programs & Features > Microsoft Office > Change in the Windows Control Panel)?
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Newbie
    Joined
    Nov 2013
    Posts
    4
    Location
    Hi Paul,

    Thanks for taking the time to answer this!

    The user does have access to the folder that contains the image. The image appears at the top left of the header.

    As for repairing Word. I don't have the facilities to do that in my organisation, however I got the user's virtual PC profile recomposed so that reset it to the same as everyone else in the company (all of which can run the macro without error).

    Any other thoughts? It's quite baffling.

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Get your Sys Admin to do a repair...
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    VBAX Newbie
    Joined
    Nov 2013
    Posts
    4
    Location
    I'll try that and see if it makes the difference. Thanks for the suggestion.

  6. #6
    VBAX Newbie
    Joined
    Nov 2013
    Posts
    4
    Location
    Hi Paul,

    Just letting you know that our system admin gave the user a new profile rather than doing a recompose. That sorted the issue. I would like to think that a repair would have worked as well.

    Thanks for your help.


    Andre

Posting Permissions

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