I'm running through a script that creates a directory listing of *.xls* files. For each file found, I open with XLOpen (non-visible), pull and process some data, eventually closing that file with XLQuit. The files are created outside of my control, and are read-only files.
I'm running MacroScheduler currently on an XP sp3 machine using Microsoft Office 2003. The files I'm opening were created in a MUCH more recent version of excel (thus, .xlsx) but because of my older machine, the files are being run through a converter (I'm assuming something like a 'plug-in' so that older versions of Excel can open these files).
At any rate, I'm finding that the XLQuit is not closing the Excel files, and after a run, I have multiple instances of Excel running on my local machine.
Any suggestions? Script code is as follows:
Code: Select all
GetFileList>S:\customer\Southwest University\Robot project\credit transfers\*.xls*,ws-file-list,|
Separate>ws-file-list,|,ws-name-files
If>ws-name-files_count = 0
MessageModal>No excel files to process, ending script
GoTo>EndRoutine
endif
let>i=0
Repeat>i
let>i=i+1
//open an xls file
XLOpen>ws-name-files_%i%,0,ws-name-xl-handle
//pull the ssan, school, and term. remove - from ssan
XLGetCell>ws-name-xl-handle,Sheet1,7,2,ws-no-ssan
XLGetCell>ws-name-xl-handle,Sheet1,4,4,ws-name-school
XLGetCell>ws-name-xl-handle,Sheet1,9,2,ws-date-term
//split the ssan into 3 parts - can't send '-' to diamondd
MidStr>ws-no-ssan,1,3,ssan-1
MidStr>ws-no-ssan,5,2,ssan-2
MidStr>ws-no-ssan,8,4,ssan-3
//here, I'm looking at a screen in a rdp session, doing some comparisons, using data to inquire,
//all working appropriately. At this point, then I need to loop through the .xls file I've just opened:
wait>1
//now. start at row 16. while our course-id is not 'Total', find a blank hours cell, perform subroutine
let>row=16
let>ws-flag-first=Y
XLGetCell>ws-name-xl-handle,Sheet1,row,1,ws-id-course
while>ws-id-course<>Total
XLGetCell>ws-name-xl-handle,Sheet1,row,3,ws-hours
If>ws-hours<1
Gosub>processCredits
EndIf
let>row=row+1
XLGetCell>ws-name-xl-handle,Sheet1,row,1,ws-id-course
EndWhile
XLQuit>ws-name-xl-handle
Until>i,ws-name-files_count