Thread: Auto_open MAcro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Auto_open MAcro

Dim StartLine As Long

With ActiveWorkbook.VBProject.VBComponents("Module1").C odeModule
.InsertLines .CountOfLines, _
"Public Sub Auto_Open()" & vbCrLf & _
"Dim ans" & vbCrLf & _
" ans = Msgbox( ""All OK"",vbYesNo)" & vbCrLf & _
" If ans = vbNo Then Cancel = True" & vbCrLf & _
"End Sub"
End With



--
__________________________________
HTH

Bob

"John McCabe" wrote in message
ng.com...
I have a TOC(table of contents) macro and it works great. Also have the
auto_open macro to start on the first sheet.
Trying to give users the option of creating the TOC sheet and then of
course always start on that sheet. But would have NO auto_open unless
they actually want the TOC sheet to be there. Somehow is there a way to
have the TOC macro create also the auto open macro