ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet Activate method in beforesave event (https://www.excelbanter.com/excel-programming/357683-sheet-activate-method-beforesave-event.html)

bdg

Sheet Activate method in beforesave event
 
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



All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com