Click event to run only once

  • Thread starter Thread starter gavmer
  • Start date Start date
G

gavmer

HI there,

small problem........i was hoping that once the code ran...that was it.
Prob is, when the file is saved, closed and then open again, the code
can run once more. I will run only once when clicked on un-saved file
but i want to prevent a user from running the code more than once
permanently. Can someone help???

Cheers!!!
 
Gidday,

In a general module


dim mintNumNuts as integer
sub Auto-Open()
mintNumNuts=0
end sub




In the routine to save,

before save option

if mintNumNuts<>0 then
msgbox "This workbook can not be saved",vbcritical
activeworkbook.close false
exit sub
end if

mintNumNuts=1




regards
mark









-Mark
 

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

Back
Top