Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a file and disabling open events
Hi All
I have a an application (workbook) running some VBA code, I want this code to open another application (workbook) but prevent its open events being fired to prevent the opened workbook VBA code running. How do I do this? Cheers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a file and disabling open events
Nigel,
Something like the following should work. You'll probably want to add some error checking. Dim WB As Workbook Application.EnableEvents = False Set WB = Workbooks.Open("C:\Book1.xls") Application.EnableEvents = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Nigel RS" wrote in message ... Hi All I have a an application (workbook) running some VBA code, I want this code to open another application (workbook) but prevent its open events being fired to prevent the opened workbook VBA code running. How do I do this? Cheers |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a file and disabling open events
Thanks Chip, works a dream!
"Chip Pearson" wrote: Nigel, Something like the following should work. You'll probably want to add some error checking. Dim WB As Workbook Application.EnableEvents = False Set WB = Workbooks.Open("C:\Book1.xls") Application.EnableEvents = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Nigel RS" wrote in message ... Hi All I have a an application (workbook) running some VBA code, I want this code to open another application (workbook) but prevent its open events being fired to prevent the opened workbook VBA code running. How do I do this? Cheers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disabling Events: Dangerous? | Excel Programming | |||
Disabling Events | Excel Programming | |||
disabling linked object before you open a file | Excel Discussion (Misc queries) | |||
Prevent user disabling events | Excel Programming | |||
Disabling Events | Excel Programming |