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