ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to stop macros in 2nd workbook? (https://www.excelbanter.com/excel-programming/284193-how-stop-macros-2nd-workbook.html)

Joe 90[_2_]

How to stop macros in 2nd workbook?
 
Hi

I have an excel vba app that is used to collect data about risks in our
organisation. It uses userforms that start up with the spreadsheet.

I have created another spreadsheet in order to collect this data and create
reports. However, I need to open up the first spreadsheet to access the
data. I cannot find a way to stop the macros running when opening the first
spreadsheet from within the second through code, i.e. like holding down the
shift key as it opens.

Is there a way to emulate this through vba code in Excel?

I have tried sendkeys but it can't access the first sheet because its code
takes over when it opens :(

Thanks

Joe


Jim Rech

How to stop macros in 2nd workbook?
 
Use Application.EnableEvents = False prior to opening the workbook. Reset
it afterward.

--
Jim Rech
Excel MVP




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

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