Sheet activate method in beforesave event

  • Thread starter Thread starter bdg
  • Start date Start date
B

bdg

Hi

I would like to know why activate method in beforesave event does not
work. Could you help me?
(If you know, please let me know url of MSDN page explaining this
restriction.)

-----------ThisWorkbook Module--------------
Sub test()
ActiveWorkbook.Save
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("sheet2").Activate
End Sub
----------------------------------------------------

Case 1 When save by file menu or Ctrl+s
"Sheets("sheet2").Activate" will work.

Case 2 When run test procedure
"Sheets("sheet2").Activate" will not work.

Thanks to all,
bdg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top