NAV 2018 does not support automation servers when code is run at the service tier. Which is where is always runs by default unless told otherwise. You need to use .NET with NAV 2018. Unless you design your code to run on the client. Then there is still some support for automation.
If you do have the code running at the client, then likely the automation server is not registered.
If you've found this thread useful, dive deeper into User Group community content by role