+ Reply to Thread
Results 1 to 6 of 6

Reopen workbook application-defined or object-defined error

  1. #1
    Registered User
    Join Date
    10-21-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    3

    Reopen workbook application-defined or object-defined error

    Hi

    I have a workbook that I want to reopen. I use the following code:

    Workbooks.Open ThisWorkbook.FullName

    It reopens the workbook, but I get an application-defined or object-defined error when it opens.

    I can't figure out why I get this error. Can anyone help me with this problem?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Reopen workbook application-defined or object-defined error

    Hi, Duzze5,

    could you please explain what you are after (why do you want to reopen the workbook with the code)?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-21-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Reopen workbook application-defined or object-defined error

    Hi Holger

    I just want to reopen the workbook without getting any error.

    It is because I have a custom ribbon. It can sometimes loose the ribbonID. When it looses the ID, the easiest and most reliable way
    to regain it, is to reopen the workbook. As it is right now I get the application-defined or object-defined error when it reopens.

    Hi
    Duzze5

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Reopen workbook application-defined or object-defined error

    Hi, Duzze5,

    maybe losing the state of the global IRibbonUI ribbon object with the workbook or links provided may help with that problem.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    10-21-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Reopen workbook application-defined or object-defined error

    I used to use that solution, but there is a problem with it, that can make Excel crash. It is not very reliable. There is another way to, where you use an add-in to
    handle the RibbonID if it is lost. But the easiest way is two reopen the workbook. An alternative solution, but great and quick

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Reopen workbook application-defined or object-defined error

    Hi, Duzze5,

    then maybe store a short macro in the Personal.xlsb and assign a shortcut to it?

    Please Login or Register  to view this content.
    Or pass the path and the name as parameters to this sub.

    Ciao,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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