Certified SOLIDWORKS® Solution Partner|Built for SOLIDWORKS and SOLIDWORKS PDM Professional|Free Community Edition, no key needed

Product features

Publisher Macros: Automate PDMPublisher from SOLIDWORKS VBA

Publisher Macros in PDMPublisher for SOLIDWORKS is a built-in VBA editor that calls Save As New, Property Doctor, Clone Tree and ERP Sync from macros.

The hard part of a SOLIDWORKS macro is rarely the macro. It is the naming, the PDM check-in, the property fixes on a dozen files, the push to ERP. Publisher Macros exposes Save As New, Property Doctor, Clone Tree and ERP Sync to VBA as late-bound methods, so a macro calls a saved profile by name and PDMPublisher does the rest.

In short

  • Get the publisher object from the loaded add-in, then call publisher.SaveAsNew("BC", False), PropertyDoctor, CloneTree or ERPSync with a profile or connector name.
  • No type library reference is needed; the calls are late-bound. The built-in editor ships with a complete Sub main() example.
  • The silent argument runs without dialogs; it needs Premium for Save As New and refuses to overwrite existing files.

How it works

Publisher Macros VBA editor in PDMPublisher for SOLIDWORKS showing a Sub main() example with syntax highlighting, line numbers and the Run, OK and Cancel buttons
The Publisher Macros editor ships with a complete Sub main() example.
  1. Load PDMPublisher under Tools > Add-Ins and save the profiles and connectors the macro will use.
  2. Open PDMPublisher > Publisher Macros from the CommandManager.
  3. Replace the example profile and connector names with names that exist on this computer, and uncomment only the commands you want to run.
  4. Select Run; it executes the displayed code through SOLIDWORKS and needs a Sub main() entry point.
  5. Select OK to keep the edited code for the next session, or copy it into your own .swp macro.
PDMPublisher tab in the SOLIDWORKS 2026 CommandManager showing Save As New, Property Doctor, Clone Tree, ERP Sync, Publisher Macros, BOM Manager, Publish, Annotations, Conditions, Logs, Settings and License Key
Publisher Macros sits in the Integration group of the PDMPublisher tab, next to ERP Sync.

Settings that matter

SettingWhat to putWhy
Profile nameAn existing, unique profile nameNames are case-insensitive; a blank or ambiguous name fails.
silentFalse to show the dialogs, True for unattended runsSilent Save As New needs Premium and never overwrites.
ERPSync argumentsConnector name, direction, source type and pathNon-silent mode still lets you review and uncheck rows.
Entry pointSub main()Run looks for exactly this name.
Publisher Macros page in the PDMPublisher for SOLIDWORKS Settings dialog with the button that opens the editable VBA example
The settings page opens the same editor; retained code is stored locally.

Recipes

You wantSetYou get
A customer variant in one clickCall publisher.SaveAsNew("BC", False)The destination dialog opens, the copy is saved and checked in if the profile says so.
Property cleanup before releaseCall publisher.PropertyDoctor("Default", False)The profile’s actions are previewed, then applied.
A nightly BOM pushCall publisher.ERPSync("Odoo", "Push", "FeatureTree", "", True) from a scheduled macroItems and BOM pushed with the saved mappings.

If something looks wrong

  • The publisher object is Nothing: PDMPublisher is not loaded. Enable it under Tools > Add-Ins.
  • Run does nothing or reports a missing entry point: keep Sub main() exactly as in the example.
  • A profile name fails: it must exist on this computer and be unique.
  • Silent Save As New fails: it needs Premium, refuses existing targets, and rejects profiles that prompt the user.

Availability

Publisher Macros is part of PDMPublisher for SOLIDWORKS, the add-in that runs inside SOLIDWORKS. It is not part of the PDM Professional task. Available in the Community Edition; silent Save As New needs Premium.

Keep going

Documentation

Frequently asked questions

Can I call PDMPublisher from a SOLIDWORKS VBA macro?

Yes. Get the add-in object with Application.SldWorks.GetAddInObject(“{9BC55484-9BC0-431E-B039-E9CC13542E43}”) and call SaveAsNew, PropertyDoctor, CloneTree or ERPSync on it. Late binding means no VBA reference is required; the add-in only has to be loaded under Tools > Add-Ins.

Do I need a PDMPublisher type library reference in the VBA editor?

No. Publisher Macros uses late binding (Dim publisher As Object), so the macro works without adding any reference.

Can Save As New run without any dialog?

Yes with silent = True, which requires Premium. The saved profile must contain enough destination information to run without a prompt, and it cannot use prompt placeholders, after-save macros or automatic PDM check-in. Existing files are never overwritten.

Why does ERPSync fail when I pass silent = True?

ERP Push and Pull always require the user to review the diff before any remote or SOLIDWORKS change, so silent execution stops before connecting and returns an error. Pass False and the review window opens with your arguments preselected.

Are my macro edits saved?

Select OK in the Publisher Macros editor to retain the code for the next session; Cancel discards the edits. The retained code is stored locally for the current Windows user and is not included in exported settings bundles.

Do the older SaveAsNewWithProfile methods still work?

Yes. SaveAsNewWithProfile, CloneTreeWithProfile and PropertyDoctorWithProfile remain supported alongside the current SaveAsNew, CloneTree and PropertyDoctor methods.

Where to next

PDMPublisher for SOLIDWORKS · PDMPublisher for PDM Professional · All features · Conversion guides · Pricing · Documentation · Contact

The SOLIDWORKS add-in is free to start as the Community Edition. The PDM Professional task comes with a 7-day trial. Download the add-in or start the task trial.