vba Range.Find使用后期绑定返回null

我有一个MS Access(2007)应用程序需要更新一个Excel电子表格在一个点上。

我的用户有不同版本的MS Office不同的工作站,所以我使用后期绑定来操作电子表格。

之前我意识到我不得不使用晚绑定我写了所有的代码,它工作正常后,将其更改为迟绑定查找function返回null,即使我改变它之前工作的数据。

Private Sub SaveRejectsToExcel() Dim ExcelApp As Object Dim wbk As Object On Error Resume Next Set ExcelApp = GetObject(, "Excel.Application") If Err.Number <> 0 Then Err.Clear Set ExcelApp = CreateObject("Excel.Application") End If Set wbk = ExcelApp.Workbooks.Open(CurDir & "\TestRejectsSS.xlsx") ExcelApp.Visible = True With wbk Me.subForm.Form.Recordset.MoveFirst Do While Me.subForm.Form.Recordset.EOF = False Dim machine, tool, Rejects machine = Me.subForm.Form.getMachineNo tool = Me.subForm.Form.getMachineTool Rejects = Nz(DSum("Rejects", "SMIwDate", "SMI_Machine_No = '" & machine & "' AND Tool_ID = '" & tool & "' AND [Day] = #" & Format(Me.shDay, "mm/dd/yyyy") & "#"), 0) With .worksheets(machine) Dim rowNo, colNo Debug.Print .Cells(1, 1) 'to check its on the right sheet colNo = .Cells.Find(What:=Format(Me.shDay, "dd-mmm"), After:=.Cells(1, 1), LookIn:=xlvalues, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False).Column 'i have that date format because thats how it displays on the spread sheet, i have also tried mm/dd/yyyy and dd/mm/yyyy rowNo = .Cells.Find(What:=tool, After:=.Cells(1, 1), LookIn:=xlvalues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Row Debug.Print .Cells(1, 2) .Cells(rowNo, colNo).Value = Rejects End With Me.subForm.Form.Recordset.MoveNext Loop End With ExcelApp.DisplayAlerts = False wbk.Close savechanges:=True ExcelApp.DisplayAlerts = True ExcelApp.Quit End Sub 

为什么find现在返回null?
我是否在“迟绑定”方面做错了什么,或者是其他地方的问题?