ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running a Excel function from access vba (https://www.excelbanter.com/excel-programming/360969-running-excel-function-access-vba.html)

[email protected]

Running a Excel function from access vba
 
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


[email protected]

Running a Excel function from access vba
 
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?



All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com