Microsoft KB Archive/282335

= You receive a run-time error when you use msoFileDialogSaveAs constant with FileDialog in Access 2002 =

Article ID: 282335

Article Last Modified on 8/11/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q282335



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
If you use the msoFileDialogSaveAs constant with FileDialog in a Microsoft Visual Basic module, your code is compiled as expected. However, when you run the code, you receive the following error message:

Run-time error '445':

Object doesn't support this action



CAUSE
This behavior occurs because the msoFileDialogSaveAs constant was not designed to be used in Microsoft Access.



MORE INFORMATION
The msoFileDialogSaveAs constant is designed for other Microsoft Office programs such as Microsoft Excel or Microsoft Word. However, the constant appears in the Auto List Members list in the Visual Basic Editor for Access. The Help file does not warn you that you cannot use this constant in Access.

Steps To Reproduce the Problem
 Start Access and create a new database. On the Tools menu, point to Macro, and then click Visual Basic Editor. On the Tools menu, click References. In the References dialog box, under Available References, click to select the Microsoft Office 10.0 Object Library check box, and then click OK.

The Microsoft Office 10.0 Object Library must be referenced to use FileDialog. In the Immediate window, type the following

?Application.FileDialog(msoFileDialogSaveAs)

and then press ENTER.

Note that you receive the error message described in the &quot;Symptoms&quot; section. Click OK in the error message dialog box, change msoFileDialogSaveAs to msoFileDialogOpen, and then run the code again. Note that the Open dialog appears and no error message is returned.</li></ol>

Additional query words: pra

Keywords: kberrmsg kbtshoot kbnofix kbprogramming kbprb KB282335

-

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

© Microsoft Corporation. All rights reserved.