VB.net Error: Cannot find the interop type that matches the embedded type.
are you missing an assembly reference
I have a program that I have been building and I'm getting an error when
calling an object. I'll post my code below but the error is thrown on this
line "Dim M3Script As New MILLCOMPANYLib.CScripting"
This code is using the object model for a software that my company uses. I
understand that it is not widely used but know that it is a COM model and
really the only thing that my code is doing is pulling back a field as
String and putting into a text box for editing.
I hope that I have been thorough enough and welcome any help or advice.
Imports System.IO
Public Class FormMain
Public M3System As MILLSYSTEMLib.System
Public M3Script As MILLCOMPANYLib.CScripting
Private Sub FormMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If M3System Is Nothing Then
Me.Close()
End If
Me.RefreshList()
Me.Text = "M3 VB Script Editor - Current Database: " & M3System.DSN
End Sub
Private Sub RefreshList()
Try
For Each Company In M3System.Companies
cb_COID.Items.Add(Company.Field("co").ToString)
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub btn_LoadScript_Click(sender As Object, e As EventArgs)
Handles btn_LoadScript.Click
Try
Dim M3Script As New MILLCOMPANYLib.CScripting
'M3Script = New MILLCOMPANYLib.CScripting
Dim CoCode As String = cb_COID.SelectedItem
'Dim script As String = M3Script.vbscript
If IsNothing(cb_COID) Then
MessageBox.Show("Select a Company Code")
End If
If CoCode = M3Script.co Then
Scintillatb_Script.Text = M3Script.vbscript
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
No comments:
Post a Comment