Search code examples
excelexcel-2011vba

Method 'View' of object 'Window' failed with xlPageBreakPreview


I have a macro in which ActiveWindow.View = xlNormalView works well. However, ActiveWindow.View = xlPageBreakPreview returns an error Run-time error '1004': Method 'View' of object 'Window' failed.

Does anyone know what's wrong with that?

PS: the version of Microsoft Visual Basic is 14.4.2 under Excel for Mac 2011.


Solution

  • Although the VBA editor for Mac has the xlPageBreakPreview property it won't be able to execute because there is no page break preview mode in Excel 2011. That is why this will always return an error when executed within Excel 2011.