PDA

View Full Version : [SOLVED:] HELP - Adding InlineShapes Doesn't work on 1 PC. It Works on ALL Other PCs



Alves76
11-22-2013, 09:13 AM
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

macropod
11-22-2013, 11:32 PM
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)?

Alves76
11-25-2013, 07:48 AM
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.

macropod
11-25-2013, 10:51 AM
Get your Sys Admin to do a repair...

Alves76
11-26-2013, 02:11 AM
I'll try that and see if it makes the difference. Thanks for the suggestion.

Alves76
12-03-2013, 05:11 AM
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