Hi,

You are double declaring your string. You don't need to pass the function anything so it would be. You also didn't define the function as the value.

[VBA]Function fnOperatingSystem()
Dim sOSVer As String
sOSVer = Application.OperatingSystem
fnOperatingSystem= sOSVer
End Function[/VBA]

To be honest for something this simple I wouldn't bother with a function. Just use a variable directly in your sub and assign the value directly to it. If you want to use it as a function the above will work and you would call it with a sub.

[VBA]Sub getos()
Dim sOS As String
sOS = fnOperatingSystem
MsgBox (sOS)
End Sub[/VBA]