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

            SboGuiApi.Connect(sConnectionString)

            'Suggestion  to given in  this link    

            Thread.Sleep(10)

        Catch ' Connection failed

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

            End

        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 ?

    Regards

    Edy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Edy Simon

      sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

      Below is my command line arguement

      0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056

      It happens  During  Developement