Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Workbook_Open macro doesn't work for trusted documents

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
Code:
Sub Workbook_Open()
MsgBox "OK"
End Sub

Sub Workbook_BeforeClose(cancel As Boolean)
MsgBox "OK"
End Sub

The code above works perfect in a new excel workbook.
Opening the workbook a got a message to enable the macro's and the Workbook_Open macro is running after enabling the macro's.
Closing the document the Workbook_BeforeClose macro is also running perfect.

But after the document is marked as trusted, either marked as a trusted document or using a digital signature from a trusted publisher the Workbook_Open macro doesn't work anymore.
All other macro's in the document are working fine and also the Workbook_BeforeClose is activated closing the document.
After removing the mark as a trusted document, the message to enable all macro's is popping up again and the Workbook_Open macro is running again.....

Has someone an explanation why only the Workbook_Open macro doesn't work for trusted documents ???
 
Check if trusted documents are enabled in Trust Center.

combo
 
Check if trusted documents are enabled in Trust Center.

combo
 
The option disable trusted documents is unchecked !
All other macro's are working just the Workbook_Open macro doesn't run when then document is opened ones untill I clear all trusted documents. Then the macro Workbook_Open runs again opening the document.....????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top