Weldment custom properties are different than document custom properties (but you already knew that). I looked over the macros in your workbook. Must be an old macro you copied; the calls used have been obsolete for about 10 years (however they still work). Since you like to tinker on your own. Look up "Get Solid Bodies from Cut-list Folders and Get Custom Properties Example" in API help for retrieving weldment custom properties.
In the meantime, I am not familiar with the calls used to set the cell range from A - Z, so I will need to do some time to dissect it (although this close to the holidays does not give me a lot of time)...
I've been doing it manually up till now, so I'll be fine until you have time to look at. I appreciate that fact that you reviewed it. I had to spend an hour with Google Translate just to even pretend I knew his methodology. In the 2014 or 2015 Solidworks API help section I was able to find code to extract the custom properties from a weldment. It could have been written in Greek, and it wouldn't have affected my understanding of it. I'm a big believer in not reinventing the wheel, but it is way over my head. I'll attach it and maybe it can help you in your review. The code on top is the translated version from the Excel file, and the code below the dashed line is the code I found in the API Help section.
FYI, I download the excel file with the code in it. You just open up Solidworks without opening the file, and it opens the file, exchanges the custom property data, and then closes the file.
Weldment Propo.txt.zip 1.5 KB
By looking at your text file, it looks to me you have figured out how to get the code to go out to column CJ. I could not get the code to run properly because your example file did not have any properties in them.
The code you included for getting the cut list properties does not look right to me. I did not think the cut list folder is a sub feature. I quickly wrote some code for use as a SolidWorks macro; it should give you a guide (hopefully) for what you need to do in Excel.
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Sub GetCLProp(swCLFeat As SldWorks.Feature)
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim vCustPropNames As Variant
Dim vCustPropName As Variant
Dim ValOut As String
Dim ResValOut As String
Dim WasRes As Boolean
Set swCustPropMgr = swCLFeat.CustomPropertyManager
vCustPropNames = swCustPropMgr.GetNames
For Each vCustPropName In vCustPropNames
swCustPropMgr.Get5 vCustPropName, False, ValOut, ResValOut, WasRes
Debug.Print , vCustPropName, ResValOut
Dim swFeat As SldWorks.Feature
Dim swSubFeat As SldWorks.Feature
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set swFeat = swDoc.FirstFeature
Do Until swFeat Is Nothing
Set swFeat = swFeat.GetNextFeature
If swFeat.GetTypeName2 = "EqnFolder" Then Exit Do
Debug.Print swFeat.Name, swFeat.GetTypeName2
If swFeat.GetTypeName2 = "CutListFolder" Then GetCLProp swFeat
Set swFeat = swFeat.GetNextFeature
Sorry about the delayed response. I had to go down to nowhere Mexico the day after Christmas to handle some systems issues, and just got back in last night. The top code is simply the code from the Excel file, with the Finnish translated into English so I could understand his steps. The code isn't run in solidworks. You open the excel file and you start Solidworks but you don't open any files. You enter the path in the excel file and then in D3 you enter the total amount of custom properties you have in a part or assembly (depending on which tab you're on). Then hit the Read Data button and it will extract the custom property data from the file by opening the file in Solidworks, saving the file, and then closing the file. The number of custom properties must include the number of auto-populated from Solidworks. So there are no individual properties in the code. The file I attached is a multibody weldment and the Excel API doesn't work on those. If you need a file with custom properties I can post another. As far as the second code, it was an API example written by Solidworks on extracting custom properties from weldments and multibody parts. I couldn't tell you if it's a recipe for KFC coleslaw or plans to build a robot. It just simply over my head.
Please look at the code I supplied to see you it works for you (or maybe it is a Mars Burger recipe).
Solid Air wrote:
(or maybe it is a Mars Burger recipe).
That made my day