Microsoft KB Archive/873433

= Error message when you try to modify the text in a PowerPoint object by using Visual Basic Editor: &quot;Run-time error -2147467259 (80004005)&quot; =

Article ID: 873433

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft Office PowerPoint 2007
 * Microsoft Office PowerPoint 2003
 * Microsoft PowerPoint 2002 Standard Edition

-





SYMPTOMS
When you try to modify the text in a Microsoft PowerPoint 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 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, &quot;TextRange (unknown member) : Invalid request. Presentation cannot be modified.&quot;) = 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 &quot;Applies to&quot; section.

Additional query words: PPT2007 PPT2003 vbe ppt ppt2002 ppt2k2 ppt10

Keywords: kbvba kbcode kbsample kbtshoot kbnofix kbprb KB873433

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.