Based on feedback from quite a few other Coreldraw users I believe I've confirmed the existence of a DXF export bug in v2017 (as well as X7 and X8).
This bug only seems to happen with DXF export and disabling layers. The object on the layer which has export disabled, still exports.
Is it possible to get around this problem with a VBA macro ?
There is certainly some way to do that with a VBA macro. Some approaches are uglier than others.
How one might go about that will have a lot to do with how the document is structured.
I'll start off with the assumption that you want to exclude some content "by layer" - because that's what you were previously using layer printability for to control what is exported.
For the content that you DO want to export:
I may temporarily lock objects or a layer so I don't accidentally change them while working on nearby objects.
Also I do sometimes turn off layer visibility when I have a lot on a page.
If it makes things simple, for exporting I can simply unlock everything, and make everything visible before exporting.
How does that suit things ?