How does Excel determine if a file is already in use?

  • Thread starter Thread starter Paul MacFarlane
  • Start date Start date
P

Paul MacFarlane

Is it only if the OS tells it?

I've posted a message (with no response) so I'm asking a different way.
 
In VBA terms, it would be part of the Workbooks collection.

If you were so inclined, here is a UDF (User Defined Function) that
would tell you if a specific book is open.

Function IsOpen(wbook As String) As Boolean
Dim wb as Excel.Workbook

IsOpen = False

On Error Resume Next
Set wb = Workbooks(wbook)
If Err = 0 then
IsOpen = True
End If
On Error Goto 0

Exit Function


HTH,
JP
 
Thanks JP...

What I am finding is there are some other things going on with this workbook
too...
If I copy the workbook to a local drive I get this XLQUERY.XLA missing
message: http://support.microsoft.com/kb/277620
Although the workaround doesn't...

But having it work from the local drive indicates a network (OpLocks)
problem.



In VBA terms, it would be part of the Workbooks collection.

If you were so inclined, here is a UDF (User Defined Function) that
would tell you if a specific book is open.

Function IsOpen(wbook As String) As Boolean
Dim wb as Excel.Workbook

IsOpen = False

On Error Resume Next
Set wb = Workbooks(wbook)
If Err = 0 then
IsOpen = True
End If
On Error Goto 0

Exit Function


HTH,
JP
 
What version of XL are you using? If you aren't using XL 97, you
shouldn't be saving in that format (unless you need backward
compatibility for some reason).

--JP
 
XL2003...

Not saving in that format. The person that created the file doesn't have
XLQUERY.XLA on his machine either...

What version of XL are you using? If you aren't using XL 97, you
shouldn't be saving in that format (unless you need backward
compatibility for some reason).

--JP
 
Sorry, if you read that KB and tried the workaround and it still isn't
fixed, there's nothing else I can suggest.

--JP
 
Thanks.


Sorry, if you read that KB and tried the workaround and it still isn't
fixed, there's nothing else I can suggest.

--JP
 
Back
Top