system.runtime.interopservices.COMexception(0x80004005) Unspecified error!!

09-14-2011 02:53 AM
Occasional Contributor II

Please note that while I was trying to start and edit session programmatically from a VB.Net code in ArcMap 9.1 SP2. I wonder that I got the following error:

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error at ESRI.ArcGIS.Editor.IEditor.StartEditing(IWorkspace workspace)

Please advise after looking for my below used code:

        Dim pUid As UID
        pUid = New UIDClass
        pUid .Value = "esriEditor.Editor"
        Dim pEditor As IEditor
        pEditor = CType(g_pApp.FindExtensionByCLSID(pUid), IEditor)

        'Check to see if a workspace is already being edited.
        If pEditor .EditState = esriEditState.esriStateNotEditing Then
            pEditor .StartEditing(workspaceToEdit)
            Return True
            Return False
        End If

Please help it is very urgent....
0 Kudos
1 Reply
Occasional Contributor II
Do you have a layer from the defined workspace in the map? If not StartEditing will fail.

If this isn't the case please provide some more details on the workspace you are trying to edit.
0 Kudos