Last active
August 29, 2015 14:27
-
-
Save kbaesler/68a4609b8354be632fe6 to your computer and use it in GitHub Desktop.
A VBA script that will reconcile the version without locking the parent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Reference Miner & Miner 9.x Geodatabase Library | |
Sub NonLockingReconcile() | |
On Error GoTo ErrorHandler | |
Dim conflictWindow As IConflictsWindow3 | |
Dim editor As IEditor | |
Dim editorID As New UID | |
Dim conflictID As New UID | |
Dim hasConflict As Boolean | |
Dim workspace As IWorkspace | |
Dim version As IVersion | |
Dim versionEdit As IVersionEdit4 | |
Dim versionInfo As IVersionInfo | |
conflictID = "esriEditor.ConflictsWindow" | |
editorID = "esriEditor.Editor" | |
Set editor = Application.FindExtensionByCLSID(editorID) | |
Set conflictWindow = editor.FindExtension(conflictID) | |
If (editor.EditState <> esriStateEditing) Then | |
MsgBox "You must be editing to reconcile." | |
Exit Sub | |
End If | |
Dim au As IMMAutoUpdater | |
Set au = New MMAutoUpdater | |
au.AutoUpdaterMode = mmAUMNoEvents | |
Set workspace = editor.EditWorkspace | |
Set version = workspace | |
Set versionEdit = workspace | |
Set versionInfo = version.versionInfo | |
hasConflict = versionEdit.Reconcile4(versionInfo.Parent.VersionName, False, False, True, True) | |
If (hasConflict) Then | |
conflictWindow.Visible = True | |
conflictWindow.Reset | |
Else | |
MsgBox "Reconcile completed." | |
End If | |
Exit Sub | |
ErrorHandler: | |
MsgBox Err.Description | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment