Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how i open another sheet in the same workbook without closing? kamrul Excel Discussion (Misc queries) 2 February 14th 09 08:31 AM
Open each file in a folder and closing it Ayo Excel Discussion (Misc queries) 3 September 22nd 08 09:03 PM
Excel program remains open after closing file RPC Excel Discussion (Misc queries) 9 February 7th 08 07:59 PM
closing file with multiple windows open gvanhoy3 Excel Worksheet Functions 1 November 15th 06 06:31 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"