运行时错误“91”:适用于Mac VBA的Excel 2011

我正在创build一个将每周报告中的信息导入主工作表的macros; 我已经经历了几个步骤,但仍然遇到与我的Cells.Find编码错误。 我不知道为什么会发生这种情况,因为macroslogging器编写相同的代码,只是用一个variablesreplace我的手动input。

附加的是粗体中有问题的行。

Sub Pull_W01_Data_Click() Dim Advisor As Variant 'defines advisor name from first subroutine Dim Buddy As Workbook 'defines xxx as destination file Dim x As Workbook 'defines existing report file as source Dim Destination As Range 'defines destination range of data pulled from report file Advisor = Worksheets("Advisor Summary").Range("A1").Value Set Buddy = Workbooks("file1name.xlsm") Set x = Workbooks.Open("file2name.xlsm") Set Destination = Workbooks("file1name.xlsm").Worksheets("Input").Range("B2:S2") 'check if advisor name is entered If Advisor = "" Then MsgBox ("Your name is not visible; please start from the Reference tab.") Worksheets("Reference").Activate Exit Sub End If x.Activate Cells.Find(What:=Advisor, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate ActiveSheet.Range("$A$2:$DQ$11").AutoFilter Field:=1, Criteria1:=Advisor Range("A7:CD7").Select Selection.Copy Destination.Activate ActiveSheet.Paste Application.ScreenUpdating = True ActiveWorkbook.Save End Sub 

与运行时错误91:

Cells.Find(What:= Advisor,After:= ActiveCell,LookIn:= xlFormulas,LookAt:= xlPart,SearchOrder:= xlByRows,SearchDirection:= xlNext,MatchCase:= False).Activate

有任何想法吗? 我的语法closures了吗? 我弄乱了variables的名字吗?