none
Select PageLayout View in Excel on opening RRS feed

  • Question

  • Hi,

    is it possible to have a VSTO Excel document project selecting PageLayout view initially? Is there some opportunity to trigger simulated click on an existing Ribbon control or similar?

    Thanks in advance!

    Friday, November 18, 2011 3:58 PM

Answers

  • Hi Soletan

    Which version of Excel are we talking about?

    Theoretically, I'd think you could set the view in the Startup event (ThisWorkbook_Startup)... I think it would be something like:

    this.ActiveWindow.View = Excel.XlWindowView.xlPageLayoutView;


    Cindy Meister, VSTO/Word MVP
    Friday, November 18, 2011 6:45 PM
    Moderator

All replies

  • Hi Soletan

    Which version of Excel are we talking about?

    Theoretically, I'd think you could set the view in the Startup event (ThisWorkbook_Startup)... I think it would be something like:

    this.ActiveWindow.View = Excel.XlWindowView.xlPageLayoutView;


    Cindy Meister, VSTO/Word MVP
    Friday, November 18, 2011 6:45 PM
    Moderator
  • Hi Cindy,

    thank you for instantly responding. It's a document project (not an add-in) tested with Excel 2010, but designed to work with Excel 2007 as well.

    Your code didn't work as given, but googling for it lead to the working code:

    Application.ActiveWindow.View = Excel.XlWindowView.xlPageLayoutView;

    Best Regards!

    Friday, November 18, 2011 9:26 PM