Jim,
I do not think that there should be difference. I believe the syntax should be:
lnresult = .Run("MyCalcSum(1,3)")
>Thanks for the response. Is there a different way to call a subroutine that I created in Excel? The code I have is below.
>
>Excel Spreadsheet Code sheet 1 code
>
> Public Function MyCalcSum(number1 As Integer, number2 As Integer)
> MyCalcSum number1 + number2
> End Function
>
>
>I 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 With
>
>
>I get the following error message when I run the code above:The macro 'MyCalcSum' cannot be found.
>
>Thanks
>
>Jim