And since you're working with a text file, it' will never contain code. That
means that Thisworkbook would never refer to the text file.
But you can do this:
dim wkbk as workbook
'''a bunch of code
Workbooks.OpenText Filename:=varArchivo, Origin:= ....
'right after the .opentext line
set wkbk = activeworkbook
'''another bunch of code
wkbk.close savechanges:=false
carloshernandezy wrote:
>
> Thanks Dave for your help, I finally took your suggestion.
>
> One more cuestion, itīs possible to close the *.txt without saving any
> changes, after copying some data. I have problems with
> "ThisWorkbook.Close savechanges:=False" because it is not already a
> workbook. Can I change this for a txt file?
>
> Thanks
--
Dave Peterson
Bookmarks