Hi Fred, thank you very much for the reply, I used the KernelFnc and it works. To get to generate the report I added the lines GuiControl([btnNext]) and GuiRun([Click]) to open the Standard Report form and it works, but when I added the lines GuiControl([btnGenerate]) and GuiRun([Click]), I get this...