Cannot create an instance of .NET class in NAS

Boom-BoxBoom-Box Member Posts: 27
edited 2015-10-02 in NAV Three Tier
Hi Gents,

I have found and read attentively quite a few related topics, but unfortunately none had a solution for my case:

I created a codeunit that reads emails from outlook in NAV 2015 using .NET variables. All works perfectly on the client, now I am trying to call it from the NAS.

Because it is being called from a server, I turned the RunOnClient property to No.
And I get the error:
Cannot create an instance of the following .NET Framework object: assembly Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, type Microsoft.Office.Interop.Outlook.ApplicationClass.

I have installed office recently in the server, the DLLs in the client, service and GAC folders are all unblocked.

The code/variables that cause the error are:
CLEAR(Application);
Application := ApplicationClass.ApplicationClass();

where

[b]Application	[/b] Microsoft.Office.Interop.Outlook.Application.'Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'	
[b]ApplicationClass	[/b]Microsoft.Office.Interop.Outlook.ApplicationClass.'Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'	

I have redeclared and changed the variables to compiled them from scratch in this server after seeing some related issues in the forum but no good so far.

Any hint you can provide will be extremely helpful!

Thank you

Comments

Sign In or Register to comment.