SjrH (IS/IT--Management) (OP)
7 Sep 06 9:01
Thanks guys :)
I stumbled upon the answer 10 or so mins after I first posted.
As PHV states above, all I need to do was simply use
fso.getbasename(ofile.name) as opposed to (ofile.shortname)
I'm sure all the other suggestions are just as viable to!
So this is what I used to pull selected data from 4 worksheets in 5000+ files, and write it into one...
On Error Resume Next
set xlapp = createobject("excel.application")
set wbtarget = xlapp.workbooks.open(smaster)
set tgtworksheet = wbtarget.worksheets("sheet1")
set fso = createobject("scripting.filesystemobject")
for each ofile in fso.getfolder(sfolder).files
set wbsource = xlapp.workbooks.open(ofile.path)
'Get number of Apps
set srcworksheets = wbsource.worksheets("Applications")
'Get number of printers
'Get number of profiles
'Get last log on
'get IP address
set srcCell = srcWorksheets.Cells(2, 4)
if srcCell="" then Set srcCell = srcWorkSheets.Cells(7, 4)
Huge thanks to Tsuji for the script samples submitted in my other thread, some of which are used here :)
I knew absolutely nothing about scripting a week or so ago, i'll certainly be using it a lot more now!
Now on to getting it all into access, oh joy :(
Listen to those who know, believe in those that do