Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find in Excel from Access 97

Status
Not open for further replies.

timotai

Technical User
Apr 13, 2002
119
GB
Hi all

Here is my code:

Code:
Dim workbooks As Document
Dim xlApp As Object
Dim workbook As Object
Set xlApp = CreateObject("excel.application")
xlApp.Visible = False
Set workbook = xlApp.workbooks.Open("C:\AWARD_PROFILES.xls")
xlApp.Visible = True

    Set sheet = workbook.Worksheets("Profile_Source")
    sheet.Activate

sheet.cells.Find(What:="VU", After:=sheet.Activecell, LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True) _
.Activate

I can't get the find function to work. It gives me the error:

Run-time error '438' Object doesn't support this property or method.

Now I think it has something to do with the Activesell bit. I put sheet before it as it is the variable I have set the object reference to for the worksheet in excel. Without sheet. it gives the following error:

Run-time error '424' Object Required

I cannot figure out how to make this work. Can anyone help??

All help and advise is greatly appreciated.

Many Thanks

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top