Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Method 'CheckIn' of object '_workbook' failed

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Method 'CheckIn' of object '_workbook' failed

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Add of object Validation Failed - please help Shokie New Users to Excel 1 July 10th 09 01:34 PM
Method Add of object Validation Failed - please help Shokie Excel Worksheet Functions 1 July 10th 09 01:33 PM
Sort method of Range Object Failed Jim Cone Excel Programming 1 November 1st 05 10:49 PM
method of axes of object failed Papa Jonah Excel Programming 2 October 20th 04 04:59 PM
Method ~ of Object ~ Failed. Joan Excel Programming 5 August 26th 03 08:13 PM


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"