Hope this is the right place to ask this question.
I recently created a data analysis tool in Excel that works by sending data to a stored SAS process (as an "input stream"), starting processes and displaying the results in Excel.
I also use some code to check and delete all active stored processes from the workbook before starting the process again.
This is executed successfully the first 2 times, but on the third attempt it fails. He always fails on his third attempt, and I cannot understand why.
Is there any kind of memory allocation for Excel VBA that is exhausted at this point? Or some other buffer that exceeded? I entered every line of VBA code and it seems to hang (in the third run) in the following line:
SAS.InsertStoredProcess processLoc, _ outputSheet.Range("A1"), , , inputStream
Code used to run the SAS add-in for Microsoft Office:
Dim SAS As SASExcelAddIn Set SAS = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
Code used to remove stored processes from the target output sheet:
Dim Processes As SASStoredProcesses Set Processes = SAS.GetStoredProcesses(outputSheet) Dim i As Integer For i = 1 To Processes.Count ' MsgBox Processes.Item(i).DisplayName Processes.Item(i).Delete Next i
The code used to insert and start the stored process:
Dim inputStream As SASRanges Set inputStream = New SASRanges inputStream.Add "Prompts", inputSheet.Range("DrillDown_Input") SAS.InsertStoredProcess processLoc, _ outputSheet.Range("A1"), , , inputStream
Greetings