Hi,
Can somebody tell me what is wrong with the code below? It wont run manually or with the task scheduler. It has worked in the past but stopped working for some reason.
Any help would be much appreciated.
Option Explicit
Dim app
Dim container
Dim orderedList
Dim n
Dim p
Call dowork
If not (app Is Nothing) Then
app.Quit
Set app = Nothing
End If
Sub dowork()
On Error Resume Next
Dim prjName
Dim prjObject
prjName = "C:\My Data\ReportDocs_DRC_Daily_Sales\SAS_DailySales.egp"
Set app = WScript.CreateObject("SASEGObjectModel.Application.4.3")
Set prjObject = app.Open(prjName,"")
Set container = prjobject.ContainerCollection
For n=0 to (container.Count -1)
if container(n).ContainerType = 5 then
Set orderedList = container(n).Items
for p=0 to (orderedList.Count -1)
orderedList(p).run
Next
end if
Next
prjObject.run
prjObject.Save
prjObject.Close
End Sub
"Doesn't run" is pretty broad. Any specifics? I'm not a VB programmer, so I can't help on the specifics of the code.
In general, if something that used to run, stops running, I look for changes in the environment. Can you still run any scheduled tasks? Perhaps IT removed or restricted that capability for users. New OS? Other new software?
Hi,
The script use to run on my old laptop with Windows 7 but recently upgraded to a new machine. The script opens the SAS query, closes and saves it but doesnt run the actually query. i can tell because the time on the query has changed. Could it be a system setting I need to change?
Any help would be great.
Thanks,
Diane
See if you can run anything from vb?
See if you can run an EG project with the scheduler?
Then get up with your IT support folks.
I have escalated this to the IT Folks as I think it could be an system setting on my laptop. I can run it on my old laptop no problem.
Thanks so much for your help.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.