View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
tony h[_130_] tony h[_130_] is offline
external usenet poster
 
Posts: 1
Default Verify before proceeding


The workbook_open module needs to be ThisWorkbook module (in VB
explorer VBAProject...Microsoft Excel Objects... ThisWorkbook)

The rest of the code in a standard module. Put some msgbox call in t
track what happens eg

Private Sub Workbook_Open()
ThisWorkbook.BuiltinDocumentProperties("Comments") = "N"
MsgBox "initialise"
End Sub



Sub mySub()
If ThisWorkbook.BuiltinDocumentProperties("Comments") = "N" Then
MsgBox "run once"
ThisWorkbook.BuiltinDocumentProperties("Comments") = ""
End If

MsgBox "do always"

End Sub

you should get "initialise" when you open the workbook. The other tw
should appear as you run mySu

--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=54781