Consulting

Results 1 to 3 of 3

Thread: Problem with objShape.delete on a specific computer.

  1. #1

    Problem with objShape.delete on a specific computer.

    Hi, folks.

    I have a Word file with a Macro that, among other things, deletes a button on the file and saves it with a different name. This is working fine on my PC (Windows 7) and other PC's (mostly windows XP) in the office, but on one particular PC (Windows XP) the code fails on the
    objShape.delete
    line in this bit of code

    If Left(ConsecutivoCorregido, 3) <> "SG-" Then
                MsgBox "El formato del consecutivo debe tener la forma SG-056-17 (tres números para identificar el memo)"
                Exit Sub
            End If
            Dim objShape As InlineShape
            Dim doc As Document
            Set doc = Application.ActiveDocument
            For Each objShape In doc.InlineShapes
                If objShape.Type = wdInlineShapeOLEControlObject Then
                    objShape.Delete
                End If
    The error window says "error 438 in execution time" (not sure if this is the exact message in English, I'm translating from Spanish) and "Object does not admit this property or method".

    Any idea why would this fail on this particular PC? The PC where it fails is running Windows XP, but so are other PCS in the office where the code runs fine.

    Thanks in advance.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Have you tried repairing the Office installation on the aberrant PC (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair)?
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Quote Originally Posted by macropod View Post
    Have you tried repairing the Office installation on the aberrant PC (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair)?
    I have not. I will try that tomorrow morning and get back to you.

    Thanks for the suggestion.

Posting Permissions

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