Skip to Content
avatar image
Former Member

Revisit To error : An attempt was made to reference a token that does not exit

Hallo  Experts ,

I  encounter this error " An attempt was made to reference a token that does not exit"    every time  i run an addon i have  created . I have also looked  at  this link     and adopted  Owen Slater Mar 11, 2007 9:20 PM  response   marked  as correct answer so i added the Thread.Sleep(10)    as shown in my code  but nothing  happens . Kindly help .

Public Sub SetApplication()


        '// Use an SboGuiApi object to establish connection

        '// with the SAP Business One application and return an

        '// initialized appliction object


        Dim SboGuiApi As New SAPbouiCOM.SboGuiApi

        Dim sConnectionString As String

        SboGuiApi = New SAPbouiCOM.SboGuiApi

        '// by following the steps specified above, the following

        '// statment should be suficient for either development or run mode

        sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

        '// connect to a running SBO Application

        Try ' If there's no active application the connection will fail


            'Suggestion  to given in  this link    


        Catch ' Connection failed

            System.Windows.Forms.MessageBox.Show("No SAP Business One Application was found")


        End Try

        '// get an initialized application object

        SBO_Application = SboGuiApi.GetApplication()

    End Sub

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 08, 2014 at 07:35 AM

    Hi Kennedy,

    1. Which SBO Version are you using ? x86 or x64 ?

    2. Which target platform are you using in your Visual Studio ?



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Edy Simon

      sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

      Below is my command line arguement


      It happens  During  Developement