ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   closing a txt file open in xl (https://www.excelbanter.com/excel-programming/299066-closing-txt-file-open-xl.html)

steve

closing a txt file open in xl
 
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?


Frank Kabel

closing a txt file open in xl
 
Hi
try
workbooks(uardbalFile).close

--
Regards
Frank Kabel
Frankfurt, Germany

"steve" schrieb im Newsbeitrag
...
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?




All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com