You VB/Navision Developers… help! When I defining an automation variable I browse the library list. When I select the automation component I get the message “Could not load the selected library”. This is a home grown automation application that works from VBA in Excel… It was compiled in VB as an ActiveX DLL Project Type. The ClsStartup properties are: DataBindingBehavior - 0 - vbNone DataSourceBehavior - 0 - vbNone Instancing - 5 - MultiUse MTSTransactionMode - 0 - NotAnMTSObject Persistable - 0 - NotPersistable Does anybody know what it takes to write one of these that will allow the Automation link in Navision to access it? Thanks, Mark Tyler
The following is a very simple function. The header of the .cls file is what is important. VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "NG_Conv" Attribute VB_GlobalNameSpace = True Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit Public Function ConvertXtoY(ByVal X) As String On Error GoTo ErrorHandling ConvertXtoY = 2*X Exit Function ErrorHandling: MsgBox "Error occurred converting" End Function
It’s possible that you have forms in your project, such as Form1. I am not sure that if this is a problem. Try removing any forms and enable “Unattended Execution” in the project properties. I have never made an ActiveX for Navision, so I am not sure this is the case. Regards, Naji Shaman
I have always used the ActiveX-DLL project template in VB to create components for use in Navision. Never had any problems with VB’s default settings. [?]