Running a Excel function from access vba

  • Thread starter Thread starter mgramos
  • Start date Start date
M

mgramos

Hi,
I am having problem running a function defined in a module in excel
from access vba.

I am currently using:

myResponse = ObjXL.Run "myWorkbook.xls!myModule.myFunction", "myArg1"

The function in excel vba is defined:

Public Function myFunction(strArg1 as string) as boolean
msgbox strArg1
myFunction = True
End function

The error I get is

Run-time error '1004':
The macro 'myWorkbook.xls!myModule.myFunction' cannot be founf

Any ideas?

Thanks,

manuel
 
I might be wrong, but I don't think you can run functions - you can run
SUBS - though I'm open to correction! Might it be easier to copy the
function across to the database, suitably altered?
 
Back
Top