title: Error: "Reference to a non-shared member requires an object reference"
body: <p>I am building a small app that is pulling script from within an object. I'm down to the portion where my code is pulling back the field from the object that has the script and I'm getting this error.</p>
  
  <p><strong>"reference to a non-shared member requires an object reference"</strong></p>
  
  <p>I'm not sure what to change or how to get around this. Does anyone out there have any suggestions?</p>
  
  <p>Here is the code that i have so far. It's a simple app that has a combobox that you choose the company from and on button click it will get the script and show it in the textbox. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>Imports System.IO
  Public Class Form1
      Public M3System As MILLSYSTEMLib.System
      Public M3Script As MILLCOMPANYLib.CScripting
  
      Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          'On Error Resume Next
          Try
              Dim Approved As Integer
  
              ' Create a Millennium system obects
              M3System = CreateObject("MillSystem.System")
              M3System.Load("Millennium")
  
              'run login script
              Dim User As Object = M3System.Login()
  
              ' See if login worked
              If User Is Nothing Then
                  'MsgBox("Login failed!")
                  Approved = 0
              Else
                  'MsgBox("Login successful")
                  'if approved=1 then the user is able to access M3
                  Approved = 1
              End If
  
              'populate combo box
              For Each Company In M3System.Companies
                  cb_COID.Items.Add(Company.Field("co").ToString)
              Next
  
          Catch ex As Exception
              Me.Close()
          End Try
  
  
      End Sub
  
      Public Sub btn_LoadScript_Click(sender As Object, e As EventArgs) Handles btn_LoadScript.Click
  
          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
          For Each CoCode In M3Script.co
              tb_Script.Text = script
          Next
  
      End Sub
  </code></pre>