There is no code to do this that I know of. To get around this:
1. Create a "dummy" worksheet with the message stating something to the effect of "If this worksheet remains visible you have disbaled macros. For this workbook to function properly you must select enable macros. Close this workbook and re-open enabling macros."
2. Protect the "dummy" worksheet to prevent anyone from altering it.
3. Via VBA, hide every worksheet with the exception of the "dummy" sheet you created earlier. You are best advised to use the xlSheetVeryHidden constant as this prevents the user from unhiding them via the 'Format...Sheet...Unhide' menu item.
4. In your Workbook_Open event procedure unhide all the worksheets then hide the dummy worksheet you created earlier.
5. In your Workbook_BeforeClose event procedure, unhide the "dummy" worksheet you created earlier and xlSheetVeryHidden the rest of the worksheets.
Summary: If the user disables macros the only sheet visible is the protected "dummy" sheet. If the user enables macros, The remainder of the sheets are 1st unhidden and the "dummy" sheet is then hidden. The reverse of this is true upon closing.