Method 'CheckIn' of object '_workbook' failed

B

Bill Schanks

I have this code:

Private Sub cmdOk_Click()

Select Case iOption

Case 1 'Save Changes and check in

Application.ActiveWorkbook.Save
Application.ActiveWorkbook.CheckIn SaveChanges:=True, _
Comments:=Me.txtNotesOnVersion, MakePublic:=False

Case 2 'Discard changes and undo check out

Application.ActiveWorkbook.CheckIn False
Application.ActiveWorkbook.Close False

Case Else 'Shouldn't happen unless there is a problem with the code

Call MsgBox("Error! Unable to determine what option was
choosen. " _
& "Please inform " & conAppAuthor, vbCritical + vbOKOnly,
conAppName)

End Select

End Sub

------

It's giving me the error:

Method 'CheckIn' of object '_workbook' failed

When I attempt to run it. It is failing at the in the option 1 code for
the checkin method. If I take the same code and run it from the debug
window it works fine.
 
B

Bill Schanks

I got this to work if I ran the code in a separate function. The way it
was, it was being run from a command button on a userform.

Could anyone explain why that makes it fail?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top