Getting run time error -2147467259 (80004005)

Vikram Mankar 1 Reputation point


I am using below code which is giving me Error: "This document cannot be checked in"

If ActiveWorkbook.CanCheckIn = True Then  
End If  

Some help required

Best Regards,

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,794 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,846 Reputation points Microsoft Vendor

    Hi @Vikram Mankar ,
    First you need to check if you have the right permission to the file. You could refer to the document about the error message.
    Then you can set Require documents to be checked out before they can be edited to yes in Library settings -> Versioning settings
    Finally, the auto-save feature in this version of Excel is off by default. It might cause the error too.
    Please either turn Auto-save on or save the changes manually, wait and until the file is successfully saved and then Check in the file.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.