Thanks for the reply Jim but that produces the same error message.
I've also tried making objwb2 a variant, and as in your example an
excel.workbook but no luck there either.
Anyone else have any ideas?
Jim Cone wrote:
Brad,
This is only a guess, try using a separate object variable for
the second workbook...
Dim objWB2 as Excel.Workbook
Dim mysheet2 as Excel.Worksheet
Set objWB2 =xlApp.Workbooks.OpenText("myfile.txt", , 1, xlDelimited,
xlTextQualifierNone, False, False, False, False, False, True, "|",
Array(1,2))
Set mysheet2 = objWB2.Sheets(1)
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware