Autofill on EPDM template

Hello

I created an EPDM template whose templates file is an Excel file.

I can correctly name this file according to the desired variables, I also manage to fill in the data card without any problem.

I would also like you to have some cells in this excel file filled in according to the variables entered in the model card, is it possible?

If so, please explain the procedure to me?

Kind regards

 

 

Hello

See here:

https://forum.solidworks.com/thread/45894

http://www.javelin-tech.com/blog/2013/04/populating-cells-in-excel/

 

In your Excel sheet cell(s) you put the following formula:

=VALPROP("CLIENT")

Note:

In the example above, CLIENT is a custom (variable) property of your Excel file that you managed to complete via your EPDM map.

1 Like

There must be missing steps in your procedure with the 'VALPORP' formula because I don't get any results

@flegendre,

Haven't you recovered one of your old documents? It was not on this document that there was a macro with a function called... VALPROP! :)

 

if @Benoit.LF, I looked at the Excel nomenclature file that had been integrated into the EPDM.

But for me, the macro didn't intervene at this level.

I copy the file.

 

 


imp_10_002-nomenclature.xls

In any case, the simple fact of putting the formula  =VALPROP doesn't work for me so there must be something else.

I'll try to use your model as a base and put my properties in it to see if it works

Indeed I don't see the function in the macro. Don't have another simpler Excel template?

But this "valprop" is necessarily homemade: it is not listed as an existing function in Excel.

I'm looking for .......

1 Like

Indeed, it doesn't seem to work as I indicate above, yet I remember being able to easily retrieve the custom properties of an Excel file (and even Word)...

I keep looking for .....

1 Like

Hello 

I have the same problem. After several searches I found a way to do it with macros.

- you have to change your file to .xlsm (to manage macros)

- Create a new sheet in the Excel file (in 1st position)

- create a new macro named "Auto_Open" with this code:

Sub Auto_Open()
infoWorkbookCustomDocumentProperties ActiveWorkbook
End Sub


Sub infosWorkbookCustomDocumentProperties(Wb As Workbook)
    Dim Value As DocumentProperty
    Dim i As Byte
    
    On Error Resume Next
    
    'Loop on the collection of predefined properties
    For Each Value In Wb.CustomDocumentProperties
        i = i + 1
        'Inserts the names of the properties in column A
        ThisWorkbook.Worksheets(1). Cells(i, 1) = Valeur.Name
        'Inserts the contents of the property in column B
        ThisWorkbook.Worksheets(1). Cells(i, 2) = Value.Value
    Next
    
    ThisWorkbook.Worksheets(1). Columns("A:B"). AutoFit
End Sub

- run the macro

- link the cells to be filled with the properties retrieved from the first sheet

- and hide the first sheet

At home it worked

No answer, optimal