Microsoft Knowledge Base Email Alertz

(920229) - Describes the VBA run-time error message that you may receive when you run a macro that uses the Application.FileSearch property in an Office 2007 program.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 920229 - Last Review: February 18, 2008 - Revision: 2.0

Error message when you run a macro to search for a file in an Office 2007 program: "Run-time error 5111"

SYMPTOMS

You run a Microsoft Visual Basic for Applications (VBA) macro in a Microsoft Office 2007 program to search for a file on your computer. When you do this, you may receive the following VBA error message:
"Run-time error 5111
The command is not available on this platform"

CAUSE

This issue occurs when you have 2007 Office programs installed on a Microsoft Windows XP computer, and the VBA macro uses the Application.FileSearch object. This object is no longer supported in 2007 Office programs.

WORKAROUND

To work around this issue, use the FileSystemObject object to recursively search directories and to find specific files. See the sample code that is provided in the following Microsoft Knowledge Base article:
185601  (http://kbalertz.com/Feedback.aspx?kbNumber=185601/ ) How to recursively search directories by using filesystemobject

MORE INFORMATION

An alternative solution might be to script the Windows Desktop Search. For more information about this feature, visit the following Microsoft Web site:
http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx (http://www.microsoft.com/technet/scriptcenter/topics/desktop/wdsearch.mspx)

APPLIES TO
  • Microsoft Office Access 2007
  • Microsoft Office Excel 2007
  • Microsoft Office PowerPoint 2007
  • Microsoft Office Visio Professional 2007
  • Microsoft Office Visio Standard 2007
  • Microsoft Office Word 2007
Keywords: 
kberrmsg kbtshoot kbprogramming kbautomation kbprb kbexpertiseinter kbexpertisebeginner KB920229
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate