View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Alan Alan is offline
external usenet poster
 
Posts: 188
Default Suppress the Disable Macros / Enable Macros Dialog


"TroyW" wrote in message
...

Here is some code that will create an Excel4Macro sheet in the
workbook. You don't need to put any macro code on the sheet. As you
noted, the presence of the Macro sheet in the workbook will force
the user to reply "Yes" to enable the macros -OR- not open the
workbook. The xlVeryHidden will hide the Macro sheet.

Troy

Sub AddMacro4Sheet()
ActiveWorkbook.Sheets.Add Type:=xlExcel4MacroSheet
ActiveSheet.Visible = xlVeryHidden
End Sub



Hi Troy,

That's perfect - exactly what I was after.

Thank you so much!

Alan.