PNG ExportEx: Overwrite fails

Hi -

I have written a macro on Corel Designer, v. 24.5.0.731, that works well on my machine, but not on the machines of my client with same version.
The macro exports a page as PNG via ExportFilter object, see code below.
On the clients maschine the export works for each new file only once!
On the second run error -2147467259 ("File already exists") is thrown, although I've set Overwrite=True

Even if I delete the file on disk, the error is thrown!
As if there is somewhere in the background the information stored "export was already done for this file" and he won't do it again.

has anybody an idea how this could be solved?

thanks, Claus

Private Function Page_to_PNG(pg As Page, strFileName As String) As Boolean
Dim struct_Exp_opt As StructExportOptions
Dim pal_opt As StructPaletteOptions
Dim ExpFilter As ExportFilter
Dim r As Rect
Dim strTargetPath As String
   
  pg.Activate
 
  Set struct_Exp_opt = CreateStructExportOptions
  With struct_Exp_opt
    .AntiAliasingType = cdrNoAntiAliasing
    .Transparent = False
    .Dithered = False
    .UseColorProfile = True
    .Overwrite = True
    .MaintainAspect = True
    .ResolutionX = 300
    .ResolutionY = 300
    .MatteColor.RGBAssign 255, 255, 255
    
    Set r = New Rect
    r.Height = pg.SizeHeight
    r.Width = pg.SizeWidth
    Set .ExportArea = r
  End With
    
  Set pal_opt = CreateStructPaletteOptions
  With pal_opt
    .Palette = "04c50f53-259a-49f8-9234-d845f92ffb9f"
    .NumColors = 256
    .DitherType = cdrDitherNone
    .DitherIntensity = 100
    .PaletteType = cdrPaletteAdaptive
  End With
 
  strTargetPath = gv_fso.BuildPath("c:\temp", strFileName)
 
  Set ExpFilter = pg.Parent.Parent.ExportEx(strTargetPath, cdrPNG, cdrCurrentPage, struct_Exp_opt, pal_opt)
  With ExpFilter
    .Interlaced = False
    .Transparency = 0
  End With
                      
  ExpFilter.Finish
 
  Page2PNG = True

End Function

Parents Reply Children
No Data