B
Ben
Hi all,
I am Access 2002 sp3. Below is my code from one of the vba module in
Access. Everything works until I reach the line oWksh.Cells.Find, that's
when I got error saying:
Run-time error '91'
Object variable or With block variable not set
sub Test (ByRef oWkbk As Excel.Workbook)
Dim dLastRow As Double
Dim oWksh As Excel.Worksheet
Set oWksh = oWkbk.ActiveSheet
oWksh.Range("A1").Select
Selection.End(xlDown).Select
dLastRow = oWkbk.Parent.ActiveCell.Row
oWksh.Cells.Find(What:="FindSomething", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
...
...
...
Set oWksh = Nothing
end sub
I am not sure what is causing the error. Can you share with me what you
notice? Perhaps an extra pair of eyes would find something I miss. Thanks
so much.
Ben
--
I am Access 2002 sp3. Below is my code from one of the vba module in
Access. Everything works until I reach the line oWksh.Cells.Find, that's
when I got error saying:
Run-time error '91'
Object variable or With block variable not set
sub Test (ByRef oWkbk As Excel.Workbook)
Dim dLastRow As Double
Dim oWksh As Excel.Worksheet
Set oWksh = oWkbk.ActiveSheet
oWksh.Range("A1").Select
Selection.End(xlDown).Select
dLastRow = oWkbk.Parent.ActiveCell.Row
oWksh.Cells.Find(What:="FindSomething", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
...
...
...
Set oWksh = Nothing
end sub
I am not sure what is causing the error. Can you share with me what you
notice? Perhaps an extra pair of eyes would find something I miss. Thanks
so much.
Ben
--