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
 
Top