prevent second copy from opening

P

pancho

use this:

function isOpen(nameS as string) as boolean
on error resume next
dim nm as string
nm=""
nm=workbooks(nameS).name
isOpen=(nm<>"")
end if

you can check like this
if isOpen("Mybook.xls") then
msgbox "MyBook.xls is already open"
else
msgbox "MyBook.xls is closed, you must open it"
end if


Francisco Mariscal
 

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