Checking to see if a file is open in Excel

C

Cindy M.

Hi =?Utf-8?B?UXVpZXRNYW4=?=,
Does anyone know how to do this using VBA
Sure. If you tell us more about what you need, where you're
VBA is running, and which version of Office is involved, we
might even be able to give you a code sample.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
G

Gary''s Student

This very simple example just looks for the workbook name:

Sub gsnu()
Dim wb As Workbook
Dim s As String
s = InputBox("enter Workbook name" & Chr(10) & "example: Book1")
For Each wb In Workbooks
If s = wb.Name Then
MsgBox (s & " is open")
Exit Sub
End If
Next
MsgBox (s & " is not open")
End Sub


Have a pleasant day!!
 

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