1 Reply Latest reply on Jun 20, 2017 10:05 AM by lab409

    Error "Cannot access partition list"

    lab409

      I wrote some code with folliwing lines:

       

        Echo "# INFO : " & "Script is started"

       

       

         Dim cellEdObj

         Set cellEdObj = CreateObject("CellEditorAddin.CellEditorDlg")

       

         Dim cellDB

         Set cellDB = cellEdObj.OpenDatabase(LIBRARY_PATH)

       

         ' Set Cell Editor visible

         cellEdObj.Visible = True

       

         ' Select the partition

         Dim cellPartition, cellPartitions, desiredCellPartition

         Set cellPartitions = cellDB.Partitions

       

         For Each cellPartition In cellPartitions

              If cellPartition.Name = CELL_PARTITION Then

                   Set desiredCellPartition = partition

                   Exit For

              End If

         Next

       

       

       

      On cellPartitions = cellDB.Partitions I hit error:

      "Cannot access partition list"

       

      Why?

        • 1. Re: Error "Cannot access partition list"
          lab409

          I found the reasons. Problem was in cellEdObj.Visible = True. If comment its line problem was dissappear.

          So right code is here:

           

           

          Sub Main()

           

               Echo "# INFO : " & "Script is started"


               Dim cellEdObj

               Set cellEdObj = CreateObject("CellEditorAddin.CellEditorDlg")


               Dim cellEdDb

               Set cellEdDb = cellEdObj.OpenDatabase(LIBRARY_PATH)


           

               ' Select the partition

               Dim cellPartition, cellPartitions, desiredCellPartition

               Set cellPartitions = cellEdDb.Partitions


               For Each cellPartition In cellPartitions

                    If cellPartition.Name = CELL_PARTITION Then

                         Set desiredCellPartition = cellPartition

                         Exit For

                    End If

               Next


               If Not desiredCellPartition Is Nothing Then

                    ChangePadstack(desiredCellPartition)

               Else

                    MsgBox "Partition name is not correct"

               End If


               cellEdObj.SaveActiveDatabase

               ' Close the Cell Editor

               cellEdObj.Quit


               Echo "# INFO : " & "Script is finishhed. Exiting"

          End Sub

          1 of 1 people found this helpful