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 BooleanDim struct_Exp_opt As StructExportOptionsDim pal_opt As StructPaletteOptionsDim ExpFilter As ExportFilterDim r As RectDim 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 = TrueEnd Function
Claus,
I am not seeing an error message. The file get overwritten correctly each time on my machine.
-Shelby
function name: Page_to_PNG
function result: Page2PNG = True
thanks for testing.
yes, also on my machine it works - but not on my clients machine.
Any idea, what could happen there?
thanks for testing!