Stanley Lai
asked on
Use Excel Worksheet Function COUPPCD and COUPNCD
I want use Excel worksheet functions COUPPCD and COUPNCD in my VBA code for Access. I have created the Excel object and use its "worksheetfunction" method to call COUPPCD and COUPNCD. But it fails. Can someone help me to solve the problem? Or if there is equivalent functions in VBA or Access?
ASKER
THX
After using the code you have provided, it still doesn't work. VBA reports that the object (which is Excel object) does not support the method COUPPCD or COUPNCD
After using the code you have provided, it still doesn't work. VBA reports that the object (which is Excel object) does not support the method COUPPCD or COUPNCD
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great it is done
Glad to help!
Make sure you have a reference to the atpvbaen.xla something like this:
Set XlsObj = New Excel.Application
XlsObj.Workbooks.Open (XlsObj.Application.librar
"\Analysis\atpvbaen.xla")
' Runs the AutoOpen macro in the add-in
XlsObj.Workbooks("atpvbaen
Good Luck!
Gary