P
patrick molloy
try changing the first two line from
to
Dim xl As object, i as Integer
Patrick Molloy
Microsoft Excel MVP
Dim xl As Excel.Application, i as Integer
Set xl = New Excel.Application
to
Dim xl As object, i as Integer
Set xl = createobject("Excel.Application")
Patrick Molloy
Microsoft Excel MVP