none
Vsto C# document-level excel workbook - issue of workbook opening minimized. RRS feed

  • Question

  • Hi 

    I have a very annoying issue. My users hate this and wants it to be fixed. 

    I created a document-level excel workbook. It works as the front-end and has SQL2008 R2  as the back-end. 

    When users open the workbook from IE, the workbook is hidden (Minimized). This didn't happen in the previous versions. Now users need to go to 'View' -> 'Arrange All' -> 'Tile' -> Ok  to bring the workbook to the sight. 

    The problem is that it does not happen to my developer machine and my testing win7 pro environment (vmware). 

    I tried the following code in ThisWorkbook_Startup. Maximize Excel Window and Maximize any workbook window.

      if (this.Application.WindowState != Excel.XlWindowState.xlMaximized)

     {
                    this.Application.WindowState = Excel.XlWindowState.xlMaximized;
     }

    foreach (Excel.Window window in Globals.ThisWorkbook.Windows)
    {
           if (window.WindowState != Excel.XlWindowState.xlMaximized)
           {
                        window.WindowState = Excel.XlWindowState.xlMaximized;
            }
    }   

    And the issue is this only works for my developer computer. 

    The users are complaining and I don't have any ideas any more to resolve this issue. 

    Does anyone can help me with this please? 

    Kind regards 

    Mark Kim

    Thursday, September 13, 2012 12:55 AM

Answers

  • Hi Mark,

    Thanks for posting in the MSDN Forum.

    Based on your issue, I think the this.Application.WindowState = Excel.XlWindowState.xlMaximized doesn't work in your scenario. It based on my experience that the Excel Object Model works fine on the Client, but not on the Server-Side.

    Here is some info about this:http://support.microsoft.com/default.aspx?scid=kb;en-us;257757

    Look near bottom for Client-Side. Hope it helps somewhat.

    Best Regards,


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    Monday, September 17, 2012 2:15 AM
    Moderator

All replies