none
GetObject on Excel 2019 RRS feed

  • Question

  • Can someone please check the following code using Excel 2019 on a Windows 10 64 computer?

            Dim oExcel As Excel.Workbook = Nothing

            oExcel = GetObject(path + filename) 'any valid path and name of an Excel workbook

            oExcel.Application.Visible = True

            oExcel.Windows(1).Visible = True

    Make sure that filename workbook is not opened before running the code and check if it opens the workbook correctly. 


    Using Visual Basic, Excel 2016 GetObject does not work correctly. It opens two Excel windows, which are blank  (no worksheets are displayed) and unresponsive. They have to be closed ending the task in Task Manager. 

    It did work with Excel 2010.

    Thanks.



    • Edited by AntSalc Sunday, February 10, 2019 9:41 AM
    Saturday, February 9, 2019 3:58 PM

All replies

  • Hi AnSalc,

    Would you specify
    (1) programming language (Excel VBA?, VB.NET?)
    (2) more code (including "path", "filename")

    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Saturday, February 9, 2019 10:59 PM
  • Hi Ashidacchi,

    I have updated my original post with the information that you requested.

    Thanks.

    Monday, February 11, 2019 8:47 AM
  • Hi AntSalc,

    I hope you will
      (1) not edit your original post, unless it has spelling error or something like that.
      (2) not mix up between Visual Basic (AKA VB.NET) and Visual Basic Application (VBA).

    If your code works fine with Excel 2010, please check which architecture Excel 2019 is, i.e. 32-bit or 64-bit, and if it is the same as Excel 2010. 

    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Monday, February 11, 2019 8:59 AM
  • This is a bug in Excel 2016 and Excel 2013 that I already reported to Microsoft.

    https://social.msdn.microsoft.com/Forums/en-US/fc7ff4bf-f5f7-4e44-b245-f76ff1b5da1b/getobject-does-not-work-with-excel-2016?forum=exceldev

    I am just trying to find out if Excel 2019 has the same bug.

    I am using the 32-bit version.

    Monday, February 11, 2019 8:15 PM
  • Hi AntSalc,

    I don't use Excel 2019, so cannot reproduce your issue.
    Please send a feedback to Excel User Voice

    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Tuesday, February 12, 2019 1:08 AM