Problem Exporting Image With Javascript

Hi.

I'm trying to export to PNG with JavaScript in Corel Draw 2020 but the image is not exporting. I do not get an error either. Can anyone let me know what I'm doing wrong?

Thank you.

This is what I'm doing:

const opt = host.CreateStructExportOptions();
opt.AntiAliasingType = host.cdrNormalAntiAliasing;
opt.ImageType = host.cdrRGBColorImage;
opt.Overwrite = true;

const exportFileName = "C:\\test.png";
host.ActiveDocument.Export(exportFileName, host.cdrPNG, host.cdrSelection, opt, undefined);