This is possible with the use of the Part Editor Dialog.
1. I work in VB.net, so this will be somewhat different than VBS or doing it with an EFM.
2. I use the following example in conjuction with an open DxDesigner project. Thus I have a prj variable here that derives from the Viewdraw application project data.
How to do it:
1. I have a module that connects to the Part Editor in the Central Library by way of Get_Part_Editor():
Public Module DX_Library_Interface
Public job As String
Public part_ed_dlg As MGCPCBPartsEditor.PartsEditorDlg
Public pdb_db As MGCPCBPartsEditor.PartsDB
Public partitions As MGCPCBPartsEditor.Partitions
Public partition As MGCPCBPartsEditor.Partition
Public parts As MGCPCBPartsEditor.Parts
Public part As MGCPCBPartsEditor.Part
Public Sub Get_Part_Editor()
'Creates a handle to the Parts Editor in Library Manager
job = prj.CentralLibraryPath
pdb_db = part_ed_dlg.OpenDatabaseEx(job, False)
If part_ed_dlg.LockServer() Then
msgbox("Could not lock database for writing")
Public Sub Drop_Part_Editor()
'Close the open library and release hooks
pdb_db = Nothing
part_ed_dlg = Nothing
2. Here is an example Subroutine that uses an externally created arraylist (obs_parts) to change the part number of certain parts in the Central Library:
Public Sub set_library_obsolete_parts()
Dim tmp As String
Dim part As MGCPCBPartsEditor.Part
Dim partition as MGCPCBPartsEditor.Partition
partitions = pdb_db.Partitions
For Each partition In partitions
parts = partition.parts
For Each part In parts
If obs_parts.Contains(part.number) Then
tmp = part.number
part.Number = tmp & "-OBS"
part.Name = tmp & "-OBS"
So I suppose you could use VBA in Excel to connect to the Part Editor then make a routine that runs against the part of the spreadsheet with the temp and formal part numbers. To do this you need to reference the MGCPCBPartsEditor COM object. Also a reference to the ViewDraw COM object if you want to use it like I do with a DxDesigner database. Otherwise just simply provide the path to the Central Library in string format in place of how I do it with the job = prj.CentralLibraryPath method.