Open file disable macros (Excel 97/vba)
I have a macro in an excel workbook which opens another excel workbook. I wish to DISABLE MACROS in the second workbook, read from it, then close without saving changes.
Workbooks.Open sFile 'sFile is variable with path+name of second workbook
sFormName = ActiveWorkbook.Name
Workbooks(sFormName).Close SaveChanges:=False, routeworkbook:=False
Can anyone help me disable all macros within sFile when it opens.
Re: Open file disable macros (Excel 97/vba)
You cannot disable macros for workbooks opened using VBA, but you CAN prevent their Workbook_Open macro from running: