MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Method failed when I try to set the DefaultFilePath


Posted by Alexis Val on February 13, 2002 2:16 AM

Hello,

I need to set the Application.DefaultFilePath to "", but I get "method 'DefaultFilePath' of object '_Application failed'". However this method in the help file is Read / Write.

Thanks a lot,
Alx.


Posted by DK on February 13, 2002 2:35 AM

Which version of Excel are you using? I just tried this in Excel 2000 and it worked fine:-

Sub SetPath()
Application.DefaultFilePath = ""
End Sub

D

Posted by Alexis Val on February 13, 2002 2:40 AM

Version: "Excel 97 SR-2"
Alx.

Posted by DK on February 13, 2002 4:00 AM

Just tried the same code on a machine with XL97 installed and it worked fine. Maybe you should post the code to see if there is anything else that could be wrong.

Regards,
D

Posted by Alexis Val on February 13, 2002 9:10 AM

Dear DK,

By steps I can find why ...
On the sheet, I put a button, when this button has the focus, the method failed. When a cell is actived ... Alleluia ... Alleluia ... Alleluia

A very strange behaviour.

Thanks for your help,
Alx