Type : CREATION_INTERNE
Keine externen Daten gelesen. Das Skript verarbeitet nur Systeminteraktionen und Dateizeiger (fileref).
| 1 | OPTIONS NOXSYNC NOXWAIT; |
| 2 | filename cmdexcel DDE 'EXCEL|SYSTEM'; /* Fileref for Excel System */ |
| 3 | |
| 4 | DATA _null_; |
| 5 | fid = fopen('cmdexcel','S'); /* Check if Excel is open */ |
| 6 | IF fid le 0 THEN |
| 7 | DO; /* Excel is not open, open Excel via Windows registry */ |
| 8 | rc=system("Start Excel"); /* DOS command to open Excel*/ |
| 9 | start = datetime(); /* Note start time */ |
| 10 | stop = start + 5; /* Max time to try opening */ |
| 11 | DO while (fid le 0); /* Loop while Excel opens */ |
| 12 | fid = fopen('cmdexcel','S'); /* Check if Excel is open */ |
| 13 | time = datetime(); /* Reset current time */ |
| 14 | IF time ge stop THEN |
| 15 | fid = time; /* Set FID to terminate loop*/ |
| 16 | END; /* do while (fid le 0); */ |
| 17 | END; /* Excel is not open, open Excel via Windows registry */ |
| 18 | rc = fclose(fid); /* Close fileopen on EXCEL */ |
| 19 | RUN; |
| 1 | options noxwait noxsync; |
| 2 | x start excel; |