closing a txt file open in xl

S

steve

I have a sub in my personal macro workbook that is
suppose to close a txt file I have open in xl. The txt
files name is set to the variable uardbalfile. I try the
below statement and xl crashes

Windows(uardbalFile).close

So I try this (my txt file is the active file)

ActiveWindow.Close

When I execute this statement, before the execution is
complete, my txt file is deactivated and another workbook
that I have opened becomes active, so xl closes my other
work book not the txt file.

What am I doing wrong, any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top