VBA编译错误:方法或数据成员找不到与Mac上的button

我有一个在Windows(Office 2007)上工作的vba脚本,我现在在我的Mac上使用(Office 2011)。

一切工作正常在Windows上,但我有一个button,不运行的麻烦。

运行时,我有一个方法或数据成员找不到错误,第一个层次以黄色突出显示,.Filters.Clear突出显示为灰色。

我不知道问题在哪里

谢谢你的帮助 !

Sub Button5_Click() Application.ScreenUpdating = False 'à mettre en début de chaque macro !!! If CommandButton5 = Click Then ChDir ("Marcin2:Comptasoft:ListingClient") 'Declare a variable as a FileDialog object. Dim fd As FileDialog 'Create a FileDialog object as a File Picker dialog box. Set fd = Application.FileDialog(msoFileDialogFilePicker) 'Declare a variable to contain the path of each selected item. Even though the path is a String, 'the variable must be a Variant because For Each...Next routines only work with Variants and Objects. Dim vrtSelectedItem As Variant 'Use a With...End With block to reference the FileDialog object. With fd 'Change the contents of the Files of Type list. 'Empty the list by clearing the FileDialogFilters collection. .Filters.Clear 'Add a filter that includes all files. .Filters.Add "Fichiers texte", "*.txt" 'Use the Show method to display the File Picker dialog box and return the user's action. 'The user pressed the action button. If .Show = -1 Then 'Step through each String in the FileDialogSelectedItems collection. For Each vrtSelectedItem In .SelectedItems 'nom du fichier (adresse) temp = vrtSelectedItem 'ouverture du fichier a revoir sous une feuille excel Workbooks.OpenText Filename:=temp, _ DataType:=xlDelimited, Tab:=True Next vrtSelectedItem 'The user pressed Cancel. End If End With 'Set the object variable to Nothing. Set fd = Nothing 'Copie le nouveau nom du client sur la facture Client (feuil1) Range("A2:a5").Select Selection.Copy Windows("Facturation.xlsm").Activate Range("B19:b22").Select ActiveSheet.Paste Range("c19:c22").ClearContents 'fermer le fichier txt Workbooks(2).Close Workbooks(1).Worksheets(1).Activate End If Application.ScreenUpdating = True 'à mettre à la fin de chaque macro !!! End Sub