I made a program that takes in an excel file, then formats it the way it's supposed to look for my job, and saves it. It works great until a certain point. The first time you load a file into it and have it converted it works fine...after the conversion, though, when you load the next file and convert it I get an error on this line:
Code:
objExcel.Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
The error I'm getting is:
"Method 'Range' of object '_Global' failed"
Does anyone know why this might be the case? I can't imagine what happens between the first conversion and the second conversion that causes that line not to work!
Thanks guys, appreciate it!