"Argument not optional error"
The error message is self explanatory: You define a method that takes two arguments:
Public Function GetMeRegistry(ByVal componentName As String, ByVal RootKey As String) As String
And you call it with only one:
GetMeRegistry("ABC.OCX")
Either add the second parameter to the call, or remove it from the definition.
You probably also need to return a value from the function at some point...
But...You are lucky it doesn't compile, because it woudln't work:
Public Function GetMeRegistry(ByVal componentName As String, ByVal RootKey As String) As String
txtRegistryDetail.Text=GetMeRegistry("HKEY_...\Default")
End Function
All it does it call itself, so it'll crash with "out of stack space" pretty much immediately.