Created a dll and registered successfully with regasm runs 100% on my local machine.
Copy dll to customer's test server, register (regasm xl83.dll /tlb), I can compile my codeunit that uses the automation, I can see my functions when I design the codeunit, but during runtime on
IF ISCLEAR(ExcelSheetFormat) THEN
CREATE(ExcelSheetFormat);
This message is for C/AL programmers:
Could not create an instance of the OLE control or Automation server identified by
GUID={904B2CAB-EA6B-4171-8177-994AFE7A144A} 1.0:{C058A8CF-2369-3D95-B94A-F7B03F87B2D6}:'xl83'.xl83.
Check that the OLE control or Automation server is correctly installed and registered.
I suspect that it needs installed in the GAC, but server (and user machines) doesn't have gacutil...
Tried writing a custom application that does the following
FileInfo customClass = new FileInfo(args[0]);
new System.EnterpriseServices.Internal.Publish().GacInstall(customClass.FullName);
It doesn't give any errors, but doesn't seem to do anything either.
Answers
set regasm="C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
set regasm64="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe"
%regasm% xl83.dll /register /codebase /tlb
%regasm64% xl83.dll /register /codebase /tlb
Ewald Venter
Would'nt regsrv32.exe do the job?
My opinion:
If you design a dll used as an automation object, you use regsrv32.exe and while designing in visual studio you have to provide a proper com interface. If you design a .NET assembly and want to use it in RTC as .NET Variable, you don't have to register it at all. It just has to be located in the Add-ins directory of the middle tier and of the classic client of you want to compile. At least for 2009 R2 this should be true.
Regards
Thomas
I did write an interface for my class but regsvr32 didnt work.
Followed all the guidelines in writing a COM visible class for NAV but most posts end with registering the class with gacutil which is not always possible.
This is for a NAV5.1 installation, quite spoilt with 2009R2 and 2013's interoperability also
Regards
Ewald Venter
I have built a DLL for NAV 5.0, using good old VB6, without using regasm on the target clients, instead used regsrv32.exe. In VB6 I had to comment each function with the DispId() property.
Hope this helps.
Thomas
I am using Microsoft.Office.Interop.Excel amongst others.
Will keep it in mind and give it a try though, thanks!
Ewald Venter
in command prompt do the following:
uninstall Your previous version with regasm /u xxx.dll
then:
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 (or whatever the actual v4 build number is)
and
regasm "C:\Install\NAVcomToDoSmth.dll" /TLB:"C:\Install\NAVcomToDoSmth.tlb" /codebase
The dll worked without even adding it to the GAC.
Hope this helps to anyone.