Microsoft KB Archive/821079

= You receive an error message or an incorrect count of open documents when you run a VBA macro in Office 2003 =

Article ID: 821079

Article Last Modified on 12/14/2006

-

APPLIES TO


 * Microsoft Office Standard Edition 2003, when used with:
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Visual Basic for Applications 6.0, when used with:
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)

-





SYMPTOMS
When you run a Microsoft Visual Basic for Applications (VBA) macro in a Microsoft Office 2003 program, you may receive a &quot;command not available&quot; error message or the VBA macro may return an incorrect count of open documents.

For example, this problem may occur when you type one of the following in the Immediate window of the Visual Basic Editor:
 * ?ActiveDocument.Permission.Count
 * ?Application.Documents.Count

If you type ?ActiveDocument.Permission.Count, and then press ENTER, you may receive the following error message:

Run-time error 4248: The command is not available because no document is open.

Alternatively, if you type ?Application.Documents.Count, and then press ENTER, you may receive an incorrect count of open documents.



CAUSE
This problem may occur if you have an information rights management document open and a non-information rights management document open in the Microsoft Office 2003 program at the same time.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
For more information about information rights management, visit the following Microsoft Web site:

http://www.microsoft.com/office/editions/prodinfo/overview.mspx

Additional query words: irm OFF

Keywords: kbvba kbmacro kbprogramming kberrmsg kbprb KB821079

-

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

© Microsoft Corporation. All rights reserved.