View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] sukhin@gmail.com is offline
external usenet poster
 
Posts: 1
Default Opening a workbook withAuto-open Macros without transferring control

I have an Excel workbook (A) in excel XP that contains VBA code to open
workbook B.

Application.AutomationSecurity = msoAutomationSecurityForceDisable
Application.EnableEvents = False
Set LHSwb = Workbooks.Open(LHS_PATH & "/" & LHS_files.Value)

Application.AutomationSecurity = msoAutomationSecurityLow


Now B has some Auto_open macros in it and what happens after the the
above lines execute is that control seems to transfer to the VBA code
in B alhtough nothing really runs

My code in A is then reset and goes back to the start of the sub
without executing any statements after

Set LHSwb = Workbooks.Open(LHS_PATH & "/" & LHS_files.Value)


Any help would be appreciated.

Thanks,

Sukhin