LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default What is the test for whether a file is open?

Are you talking about a workbook file (as Mike understood) or a text file
(as I understood). If the latter are you talking about opening the textfile
in Excel, some text editor or with the Open filenumber statement

Regards,
Peter T


"Jim Luedke" wrote in message
...
Thanks both for reply.

***

Peter:

My VBA function is the only entity that ever opens the file. So my
question is, and I probably should've been more explicit:

What is the test for whether a file, *which only you yourself ever
open, inside VBA*, is currently open?

***

Mike:

Thanks very much for code. I'll give it a try.

But, are you saying that VBA has no expression telling you whether a
file *it itself* opened, is open or not? That seems odd to me.

Somewhere along the line I got the impression that you could, maybe,
test the file handle or something. If H is the handle, does something
like this work?

If H = 0 then
IKnowThatFileIsClosed = True
End If

On the other hand, when I put a trace on:

Close #H

it seems that the value of H doesn't change, i.e. become 0, on
closing. I thought it did. So I must be all wet.

Thanks much again.

***



 
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
test file - is open? karmela Excel Programming 3 November 22nd 07 07:20 AM
VBA Assistance needed to test for open file in a different direct Brent E Excel Programming 4 May 2nd 07 07:19 PM
Open Test file with VBA with a changing file number Michael from Austin Excel Programming 4 October 14th 05 03:18 PM
Open file - How to test the path ? Alex St-Pierre Excel Programming 3 February 7th 05 06:36 PM
Test for Open File Aaron Excel Programming 6 January 6th 05 12:37 PM


All times are GMT +1. The time now is 09:17 AM.

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

About Us

"It's about Microsoft Excel"