Just for information, Here's My code, please welcome for any suggestion:
'Reference to Objects and Libraries
Dim Connect_ADO As New ADODB.Connection
Dim WorkSAS As SAS.Workspace
Dim WorkManager As New SASWorkspaceManager.WorkspaceManager
Dim DefineServer As New SASWorkspaceManager.ServerDef
Dim AddObj As New SASObjectManager.ObjectKeeper
'Create SAS WorkSpace
Public Sub Create_WorkSpace()
Dim Inf As String
DefineServer.Protocol = ProtocolBridge
DefineServer.MachineDNSName = "myremoteserver.dns.com"
DefineServer.Port = 8591
Set WorkSAS = WorkManager.Workspaces.CreateWorkspaceByServer("SAS", VisibilityProcess, DefineServer, "mylogin", "mypass", Inf)
'Run code from my machine, acessing server in network
Dim SASproc As SAS.StoredProcessService
Set SASproc = WorkSAS.LanguageService.StoredProcessService
SASproc.Repository = "file:/networkpc/mycodes"
SASproc.Execute "MyCode.sas", "argument=123"
End Sub
'Finish and Close SAS WorkSpace, This code isn't working
Public Sub Finish_Workspace()
WorkManager.Workspaces.RemoveWorkspaceByUUID WorkSAS.UniqueIdentifier
WorkSAS.Close
Set WorkSAS = Nothing
End Sub