Access Calling an Excel Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone tell me why I get an "Application-defined or Object-defined
error" when I run this code?

where objXL = "Microsoft Excel"

intEndPointer = objXL.WorksheetFunction.Match _
("JOB STATUS", Worksheets(1).Range("A1:A500",0))

I have also tried using the object name (workbook and also worksheet)
instead of objXL and still can't get it to run.
 
Thanks, Alex... Now I get Error 1004: Unable to get the Match Property of the
WorkSheetFunction class in GetMyData. Match is a function, not a property,
isn't it?

intEndPointer = objXL.WorksheetFunction.Match _("JOB STATUS",
objXL.Worksheets(1).Range("A1:A500"), 0)

Is objXL = "Microsoft Excel" correct? Should objXL be something different
like the workbook, worksheet?
 
Thanks for the help, Alex. It is curious that when I use the Object Browser I
see that Excel.Application.Match is available for use. Wonder why it is
included in the Reference if it is not available for use. Well, I'll have to
go it another way. Thanks!
 
Back
Top