Public Function MyCalcSum(number1 As Integer, number2 As Integer) MyCalcSum number1 + number2 End FunctionI want to call the function above with automation code. Here is the code from the calling program.
With oExcel .Workbooks.Open ("C:\calledfromaccess.xls") lnresult = .Run("MyCalcSum", 1, 3) .Quit End WithI get the following error message when I run the code above:The macro 'MyCalcSum' cannot be found.