+ Reply to Thread
Results 1 to 3 of 3

Excel Automation: Setting WindowState throws exception in Excel2013

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2010 / Excel2013
    Posts
    2

    Question Excel Automation: Setting WindowState throws exception in Excel2013

    Hello Experts,

    I have Excel Automation code where i have following code, while trying to set the windowstate, i get COM error 80010105. The same code doesn't throw any exception when i work with Excel 2010. This occurs only with Excel2013. Please guide me.

    COM_TRY
    {
    Excel::_ApplicationPtr excelApp = context->workbook->Application;

    // Excel::XlWindowState wState = excelApp->GetWindowState();
    //excelApp->PutWindowState(Excel::xlNormal);
    excelApp->WindowState = Excel::xlNormal;
    }
    COM_CATCHV

    Thanks /Anandh

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Excel Automation: Setting WindowState throws exception in Excel2013

    I know it's Excel, but this is C#, correct? You are in a VBA forum. While there may be some with a fluency in both, I would not expect a solution here in the time you could achieve one were you to post in .NET forum.

    Also, please use code tags so as to properly display code snipits from regular text.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2010 / Excel2013
    Posts
    2

    Re: Excel Automation: Setting WindowState throws exception in Excel2013

    OK. Thanks for the suggestion.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1