Using GetObejct / CreateObject from VB6 IDE and VB6 EXE on Windows 7?
Posted on 2009-07-15
I've come across an odd situation these days and seem to be stuck. I have a VB6 EXE that is running pretty fine on Vista and Windows 7 when compiled and deployed with a setup. Every other way seems to fail.
To spot some issues, I need to troubleshoot and debug the code in the VB6 (SP6) IDE on the target system, that is Windows Seven 32-bit (RC Build 7100). I cannot get to run the application, neither compiled nor in the debugger.
I've managed to install the Visual Studio 6 and SP6 components so far, but when I run the program from the IDE, there are problems I cannot solve on my own. Starting the IDE in XP SP3 compatibility mode and with Administrator privileges works up to some point.
After starting, the program tries to connect to a running Outlook application with a GetObject(, "Outlook.Application") call that works fine on all pre-Vista systems. If Outlook is not running, the error is caught and the application waits for a few seconds before retrying (let's call this "standby mode").
Unfortunately, the GetObject call won't work even with a running Outlook instance. All I get is error 429 (ActiveX can't create object). Create??? - well, must be error message re-usage.
Almost the same happens if I try - more aggressively - with a CreateObject("Outlook.Application") command which gives me the same error but freezes the whole application (and with it, the VB6 IDE) for 30 seconds!
When I run the compiled EXE, I can see it in the Task Manager for about 10 seconds before it disappears. Nothing else happens, there are no event log entries or something helpful. It makes no difference if compatibility settings are used or not, neither if I run the program as Administrator.
I think the application would need elevated rights but I don't know how to achieve this. Same goes for the VB6 IDE that I desperately need (I know I shouldn't use it but that's the way it is)
If anyone has some more experience with maintaining old VB6 apps on a modern OS, I'd be very happy if you told me what I'm doing wrong. Thank you very much!