Task add in -> macro in epdm stream not working

Hello

I have a solidworks macro that works fine when I launch the solidworks macro.

I'd like this macro to be wired into our EPDM feed via Solidworkstask add-in.

Here is my macro, it is used to lower the block bar on a part file.

 

 

Dim swdoc As SldWorks.ModelDoc2
Dim swAllDocs As EnumDocuments2
Dim FirstDoc As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim NumDocsReturned As Long
Dim DocCount As Long
Dim swapp As SldWorks.SldWorks
Dim longstatus As Long
Dim part As Object

 

Sub FREEZE_ONE()
Set swapp = _
Application.SldWorks
Set part = swapp. ActiveDoc
If (UCase(Right(part. GetPathName, 6)) = UCase("sldprt")) Then
boolstatus = share. FeatureManager.EditFreeze(swMoveFreezeBarTo_e.swMoveFreezeBarToEnd, "", True)
part. SaveAs (part. GetPathName)
End If
End Sub

I pasted it into the script tab of the task

 

The macro does not run.

Where can this come from?

Do you know how to do it?

Thank you in advance for your feedback

Yannick


2020_03_04_22_10_03_nouvelle_tache_proprietes.png

Hello, I'm not a macro expert, but a task under pdm requires you to start or check that solidworks is active on the workstation where it runs.

Then is it assigned to the different position as a publication task or on a slave PC?

Hello g.caster,

Yes there is a slave position for publication which is always started, solidworks and Epdm as well. 

 

Cdlt