PC Review


Reply
Thread Tools Rate Thread

Copy worksheet without triggering events

 
 
JGeniti
Guest
Posts: n/a
 
      9th Jun 2008
I am trying to copy a bunch of worksheets into a new workbook. I have
been using the routine below for years and it has been working fine
until I tried to add another sheet to the array ("Input"). This sheet
has a bunch of combo boxes that trigger a variety of functions when
they are changed. Even though I have tried to turn of the event
triggers prior to copying they are still firing when it tries to paste
the page in the new workbook. Is there any way to avoid this?

Thanks,
James

* I even created a custom flag "DisableEvent" that I try to use to
avoid the triggers.

DisableEvent = True
Application.EnableEvents = False
Application.ScreenUpdating = False

Estimate.Sheets(Array("Input", "Cost Sheet Report", "Product Cost
Report")).Copy After:=NewWorkBook.Sheets("Sheet3")
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      9th Jun 2008
when you add a newworkbook disable events in the new workbook

Set newbk = Workbooks.Add
newbk.Application.EnableEvents = False

"JGeniti" wrote:

> I am trying to copy a bunch of worksheets into a new workbook. I have
> been using the routine below for years and it has been working fine
> until I tried to add another sheet to the array ("Input"). This sheet
> has a bunch of combo boxes that trigger a variety of functions when
> they are changed. Even though I have tried to turn of the event
> triggers prior to copying they are still firing when it tries to paste
> the page in the new workbook. Is there any way to avoid this?
>
> Thanks,
> James
>
> * I even created a custom flag "DisableEvent" that I try to use to
> avoid the triggers.
>
> DisableEvent = True
> Application.EnableEvents = False
> Application.ScreenUpdating = False
>
> Estimate.Sheets(Array("Input", "Cost Sheet Report", "Product Cost
> Report")).Copy After:=NewWorkBook.Sheets("Sheet3")
>

 
Reply With Quote
 
JGeniti
Guest
Posts: n/a
 
      10th Jun 2008
Thanks Joel, but I'm still getting the same result. Any other ideas?


Joel wrote:
> when you add a newworkbook disable events in the new workbook
>
> Set newbk = Workbooks.Add
> newbk.Application.EnableEvents = False
>
> "JGeniti" wrote:
>
> > I am trying to copy a bunch of worksheets into a new workbook. I have
> > been using the routine below for years and it has been working fine
> > until I tried to add another sheet to the array ("Input"). This sheet
> > has a bunch of combo boxes that trigger a variety of functions when
> > they are changed. Even though I have tried to turn of the event
> > triggers prior to copying they are still firing when it tries to paste
> > the page in the new workbook. Is there any way to avoid this?
> >
> > Thanks,
> > James
> >
> > * I even created a custom flag "DisableEvent" that I try to use to
> > avoid the triggers.
> >
> > DisableEvent = True
> > Application.EnableEvents = False
> > Application.ScreenUpdating = False
> >
> > Estimate.Sheets(Array("Input", "Cost Sheet Report", "Product Cost
> > Report")).Copy After:=NewWorkBook.Sheets("Sheet3")
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates triggering events Christopher Microsoft Access VBA Modules 2 19th Jun 2008 08:22 PM
Events not triggering =?Utf-8?B?R3JlZyBXZXR6ZWw=?= Microsoft Excel Programming 4 11th Sep 2006 05:43 PM
Control Events triggering at load. Manuel Microsoft VB .NET 0 29th Aug 2005 10:34 PM
.NET Calendar - Triggering Events bijoy Microsoft ASP .NET 0 30th Mar 2005 09:05 PM
Triggering two events Kavvy Microsoft C# .NET 1 28th Oct 2004 02:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.