ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving a workbook within VBA without executing events (https://www.excelbanter.com/excel-programming/346944-saving-workbook-within-vba-without-executing-events.html)

Patrick Seurre

Saving a workbook within VBA without executing events
 
I'm trying to use one workbook to customise a second pre-existing workbook
and then save the second workbook and close it. This second workbook though
has code associated with it's events that appear to be executed when the
..Save method is called. I've tried setting the Application.EnableEvents
property to false in the code of the first workbook and immediately before
the call to the .Save method, but each time this is called it appears to be
re-enabled when the .Save method is called (I've verified this by adding
watches and stepping through the code).

Does anybody have any idea as to why this might be happening and what I can
do to stop it?

---
Patrick Seurre

Patrick Seurre

Saving a workbook within VBA without executing events
 
And this is using Excel 2003 in case this is of any relevence...

---
Patrick Seurre


"Patrick Seurre" wrote:

I'm trying to use one workbook to customise a second pre-existing workbook
and then save the second workbook and close it. This second workbook though
has code associated with it's events that appear to be executed when the
.Save method is called. I've tried setting the Application.EnableEvents
property to false in the code of the first workbook and immediately before
the call to the .Save method, but each time this is called it appears to be
re-enabled when the .Save method is called (I've verified this by adding
watches and stepping through the code).

Does anybody have any idea as to why this might be happening and what I can
do to stop it?

---
Patrick Seurre



All times are GMT +1. The time now is 05:37 PM.

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