Unable to register a custom OCX

Hi Here’s my problem : I’ve created a custom OCX with VB that sends an ALT+F4 key. I tried to register it through the “Custom controls” menu, I have specified the location of my OCX file, then I got a message telling me that my OCX was properly registered but my control does not appear in the custom controls list. anyway I tried to use it in a “test” form, strangely I was able to declare an automation variable of my OCX type without any problem. But when I ran the form’s code I got an error message telling me that there’s no existing instance for my variable. Maybe there’s a simple way to make it work, but I’m completely new in NAVISION development that’s why I’m asking for your help :slight_smile: Regards

Why don’t you use the Windows Scripting Host Automation Server ? That one works really. There you have a SendKeys function.

Hi Indeed I didn’t see that the automation variable for the WSH was already registered [:D], thank you for your reply Thomas. BUT I tried to make it work this way and I got the same message “No existing instance for this automation variable” [:I]. I have created a variable named ‘WShell’ of the WSH automation type and the code I try to run is simply : “WShell.SendKeys(’%{F4}’)”. Can you help me to find out what’s wrong once again ? Thanks for your help Regards

And have you created a valid instance of the automation variable with IF ISCLEAR(WSHell) THEN CREATE(WSHell);?

That’s it [B)] I apologize for this newbie question many thanks for your help (Danke schön) See u

Hey jmc! You don’t have to apologize for “not knowing something”! Once, we all started as “Newbies”, and even experienced users/developers/etc. may ask questions that might be “obvious” for others … That’s why we meet here: [8D] 10 Years MBS ONLINE [8D] With best regards, Jörg