I've a sub in excel that needs to be called from access. Excel vba
 Public Function testme(value As String) As String
 Dim xlpath As String
 Dim concate As String
 xlpath=ActiveWorkbook.Path
 value = ActiveWorkbook.Name
 concate = xlpath & "\" & value     
 Let testme = concate
 End Function
i need to call above method in one of the access method.How do i call it.
 Sub Connect1()
 Dim xlApp As Variant
'Set xlApp = CreateObject("Excel.Application")
'this will launch a blank copy of excel; you'll have to load workbooks
'xlApp.Visible = True
Set xlApp = GetObject(, "Excel.Application")
    Let ans = xlApp.Application.Run("MyXLVBAProject.MyXLVBAModule.testme", 400)
'here ans has the string "500"
End Sub
    
passfilename = ActiveWorkbook.Pathto return the path?testmefrom access. Therefore, I suggest you changevaluefrom a formal parameter to a local variable. You can omit the actual parameter in the call as well. I will update my answer to show you exactly what I mean.