title: SAS VBA connection
body: <p>I tried to run a SAS code through VBA. I'm running SAS on a server. I have a test SAS program "<strong>Program1.sas</strong>" which I've kept on the server. Below is the VBA code that I've used. The SAS code is running but the output dataset is just showing the column headers and the rows are empty.Can anyone help me what could be the possible reason.</p>
  
  <pre><code>Sub Form_Load23()
   Dim obObjectFactory As New SASObjectManager.ObjectFactory
  
   Dim obObjectKeeper As New SASObjectManager.ObjectKeeper
  
   Dim obServer As New SASObjectManager.ServerDef
  
   Dim obSAS As SAS.Workspace
  
   Dim cn As New ADODB.Connection
  
   Dim rs As New ADODB.Recordset
  
   obServer.MachineDNSName = "xyz"     
  
   obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge
  
   obServer.Port = 8871
  
  
  
   obObjectFactory.LogEnabled = True
  
   Set obSAS = obObjectFactory.CreateObjectByServer("sas", True, obServer,"userid", "password")
  
  
  obSAS.LanguageService.Submit ("options source2; %include '/abc/AFP/shikhar.gupta1/amg/**Program1.sas**';")
  
  End Sub'
  </code></pre>