How to stop macros in 2nd workbook?

  • Thread starter Thread starter Joe 90
  • Start date Start date
J

Joe 90

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
 
Use Application.EnableEvents = False prior to opening the workbook. Reset
it afterward.
 
Back
Top