none
Programmatically freeze panes in selected sheet (not in active window) RRS feed

  • Question

  • Hi

    Can anybody tell me if and how I can programmatically freeze panes in selected worksheet which is no Application.ActiveWindow. Is it possible?

    Dawid

    Thursday, November 9, 2017 10:58 AM

All replies

  • Hi Dawid Sadlik,

    To enable us to help you better, you need to provide further details about your issue, environment. 
    e.g.
      Do you use Excel VBA or C#/VB.NET with Visual Studio?
        If it is Excel VBA, provide Excel version. If Visual Studio, provide programming language.
      What do you mean by "freeze panes" and "no Application.ActiveWindow"?
        Explain more details.

    Regards,

    Ashidacchi

    Friday, November 10, 2017 12:57 AM
  • Hi Dawid Sadlik,

    Why won't you use Application.ActiveWinow? Which window would you want to freeze panes?

    As far as I know, we could only use Windows.FreezePanes to freeze panes programmatically so we have to get a Window Object and then set its FreezePanes property.

    Except Application.ActiveWinow, you could also get a Window object from Application.Windows collection via Application.Windows["yourworkbookname.xlsx"] or you could iterate through the Application.Windows collection to get a window object.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 10, 2017 2:45 AM
  • Hi

    At first, thank you for yours answers. I've tried to set freeze panes to other than active (actually shown) worksheet. I've change conception and now I am upgrading freeze for panes on ActivateEvent event and it works.

    Best regards
    Dawid

    Friday, November 10, 2017 8:31 AM
  • Hi Dawid,

    I'm glad to hear that your issue has been resolved. I would suggest you mark your solution or any other helpful reply to close this thread. Thanks for your understanding. 

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 10, 2017 8:39 AM