You receive the "Run-time error -2147467259 (80004005)" error message when you try to modify the text in a PowerPoint object by using Visual Basic Editor (873433)



The information in this article applies to:

  • Microsoft Office PowerPoint 2003
  • Microsoft PowerPoint 2002

SYMPTOMS

When you try to modify the text in a Microsoft PowerPoint 2002 object by using Microsoft Visual Basic Editor and by typing Microsoft Visual Basic for Applications (VBA) commands in to the Immediate window, you may receive the following error message:
Microsoft Visual Basic
Run-time error -2147467259 (80004005):
TextRange (unknown member): Invalid request. Presentation cannot be modified.
Additionally, add-ins such as Adobe Acrobat PDF Maker may not function and do not return an error message.

CAUSE

This problem may occur if you try to modify a read-only PowerPoint 2002 presentation. Presentations that are opened as read-only will not enable the execution of an immediate VBA command in the Visual Basic Editor. Additionally, add-ins such as Adobe Acrobat PDF Maker will fail with no error message when used with this kind of presentation.

MORE INFORMATION

Presentations can be set to read-only by using one of the following methods:
  • The presentation has the Password to modify option set.
  • Open the presentation as read-only.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

To programmatically detect if a presentation is read-only, use the following code sample.

Visual Basic

Function IsProtectionReadOnly() As Boolean
    On Error GoTo Catch
    
    Dim txtRng As TextRange
    Set txtRng = ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Characters
    
    IsProtectionReadOnly = False
    Exit Function
    
Catch:
    IsProtectionReadOnly = (StrComp(Err.Description, "TextRange (unknown member) : Invalid request.  Presentation cannot be modified.") = 0)
End Function
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MajorLast Reviewed:10/11/2006
Keywords:KbVBA kbcode kbSample kbtshoot kbnofix kbprb KB873433 kbAudDeveloper kbAudEndUser kbAudITPRO