I've got a VBScript file that I'm trying to get to populate an Excel spreadsheet with the file names dropped onto it. It works with a few files, but when I try to dump like 21 or more files on it I get an error saying it can't process that many arguments.
Is there a way around this?
Code:
Dim arg, cnt
Set objExcel = CreateObject("Excel.Application")
If WScript.Arguments.Count = 0 Then
WScript.Echo "Drop files on this script to load into Excel spreadsheet."
Else
objExcel.Visible = True
objExcel.Workbooks.Add
For each arg in WScript.Arguments
cnt = cnt + 1
objExcel.Cells(cnt, 1).Value = arg
Next
End If
WScript.Quit(0)
Is there a way around this?