title: can not create activex object using C#
body: <p>I am deploying a C# application on client machine. The Application need to access code from another program, so it can scrap text from the screen of another application. It is running fine on the development machine but on the client machine it is throwing an error "ActiveX Component cannot create Object" this is where i am getting the error from!</p>
  
  <pre><code>    private ExtraSession objExtraSession;
      private ExtraSessions objExtraSessions;
      private ExtraScreen objExtraScreen;
      private ExtraArea objExtraArea;
      private ExtraSystem objExtraSystem;
      protected void sessionInitializer()
      {
          try
          {
              objExtraSystem = (ExtraSystem) Microsoft.VisualBasic.Interaction.CreateObject("Extra.system");
  
              if (objExtraSystem == null)
              {
                  MessageBox.Show("Could not create system");
                  return;
              }
              objExtraSessions = objExtraSystem.Sessions;
  
              if (objExtraSessions == null)
              {
                  MessageBox.Show("Could not create sessions");
                  return;
              }
              if (!System.IO.File.Exists("C:\\Users\\" + userid + "\\Documents\\Attachmate\\EXTRA!\\Sessions\\SAS.edp"))
              {
                  MessageBox.Show("File does not exist");
                  return;
              }
  
              objExtraSession = (ExtraSession) Microsoft.VisualBasic.Interaction.GetObject("C:\\Users\\"+ userid + "\\Documents\\Attachmate\\EXTRA!\\Sessions\\SAS.edp");
  
              if (objExtraSession == null)
              {
                  MessageBox.Show("Could not create session");
                  return;
              }
  
              if (objExtraSession.Visible == 0)
              {
                  objExtraSession.Visible = 1;
              }
  
              objExtraScreen = objExtraSession.Screen;
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.StackTrace, "Failed to initialize Attachmate sessions");
          }
      }
  </code></pre>
  
  <p>The error is generated from objExtraSession = (ExtraSession) Microsoft.VisualBasic.Interaction.GetObject("C:\Users\"+ userid + "\Documents\Attachmate\EXTRA!\Sessions\SAS.edp");</p>
  
  <p>Am I missing some step. Please help me out. Thanks in advance.</p>