Hello,
Have a look to the following procedure. I'll try to find something else...
Gérard
Sub Ouvre_XL()
Dim FichierXL As String, i As Integer
OptionsSchedule DurationUnits:=pjMinutes, EffortDriven:=False
Rep = "C:\Documents and Settings\Administrateur\Mes documents\"
OptionsSave DefaultProjectsPath:=Rep
FichierXL = Dir(Rep & "*.XLS") 'Lit le premier classeur Excel .XLS
du répertoire
If Len(FichierXL) = 0 Then
MsgBox "Aucun Classeur Excel dans ce répertoire, " & Chr(13) &
"Modifiez le répertoire de recherche", vbCritical, "Sélection de fichier
Excel pour import dans Project..."
Exit Sub
End If
Load UF_ListeXL 'Charge la boîte de dialogue
"UF_ListeXL"
UF_ListeXL.Show 'vbModeless 'Affiche la boîte Non Modale
(Version >= 2000 seulement)
End Sub
B.P.B said:
Thanks for the suggestion, Gerard, but I want to browse for and then open
an Excel file. FileOpen seems to be designed for opening another Project
file, e.g. it doesn't seem to let one specify file types like "*.xls". I
have come up with a crude but effective workaround, which is to use Excel's
Application object (which contains a FileDialog property) to instantiate the
FileDialog object in Project, since I am referencing Excel library objects
anyway. Furthermore, I have not been successful in instantiating the
FileDialog object in Project by using New either. Why Microsoft would choose
not to offer the FileDialog property in the Project Application object is
puzzling to me. I thought that Office objects were supposed to be uniformly
creatable across the Office product line.