BookmarkSubscribeRSS Feed
pramod_duvvuri
Calcite | Level 5

I have SAS EG version 7.1 and Office 2013 Installed on my system. I am trying to run my SAS projects by calling them from VBA. As a first step, I tried to call a simple PROC step using the below code I found online:

 

Sub createTable()
    Dim obObjectFactory As New SASObjectManager.ObjectFactory

    Dim obObjectKeeper As New SASObjectManager.ObjectKeeper

    Dim obServer As New SASObjectManager.ServerDef

    Dim obSAS as SAS.workspace
    
    Dim query as String
    query = "PROC SQL; CREATE TABLE ME.TABLE1; RUN;"

    obServer.MachineDNSName = "XXXXXXXXX"
    obServer.Protocol = ProtocolBridge
    obServer.Port = 8561
    obObjectFactory.LogEnabled = True

    Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")

    obSAS.LanguageService.Submit query
    
End Sub

 

But I'm getting an error at below line:

Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")

 3275_VBA ERROR.JPG

 

Can anyone please help me to move forward this error? Also, any guidance to run the SAS projects is greatly appreciated. I am new to both VBA and SAS.

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Have a read here (for code, but your code seems fine) and here (for a similar IT connection error).

 

Test your connection with itconfig2.exe .

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Discussion stats
  • 2 replies
  • 1818 views
  • 0 likes
  • 3 in conversation