Ah found the little mistake in our codes, the correct code:
Private Sub afstand()
Dim hMatlab As Object
Dim sDir As String, cdsDir As String, s1 As String
Dim Result As String
Set hMatlab = CreateObject("matlab.application")
s1 = "'"
sDir = s1 & ActiveWorkbook.path & s1
cdsDir = "cd(" & sDir & ")"
hMatlab.Execute (cdsDir)
hMatlab.Execute ("importexcel")
Result = hMatlab.Execute("afstand(1,2)")
MsgBox Result
End Sub
needed to remove the ' sign from the cdsDir, that's all