Runtime 91 Error in Visual Basic App Upon Startup when compiled on Windows 7 but running on Windows XP

VDanner
VDanner used Ask the Experts™
on
I have a pretty tried and true application I continue to develop with VB6.  I have been developing the app on Windows XP machine and it has been running successfully on our users machines, both in Windows XP and Windows 7.  Now, I have a new Windows 7 machine which I must use for development.  All seemed to go OK with install of VB6 (SP6) and a few older third party controls (ActiveResize and RoboPrint) I continue to use.  I needed to make one change to the application, which I did on the new machine and compiled, then deployed to a Windows XP and a Windows 7 machine.  It worked fine on Win7.  It fails before really even starting on the XP machine with "Runtime 91 Object variable or with block variable not set".  I tried adding some extra debugging MsgBoxs to the startup form, and it doesn't even reach that point.  Further, I am unable to access Project-References as I'm receiving "Error Accessing the System Registry" - this may be unrelated but wanted to mention.  I also had some old stuff using Crystal Reports, and I uninstalled all of that and removed it from the project, as I read this "Error Accessing the System Registry" might be related to that.  This didn't help my Runtime Error or the Registry Error.  I then tried uninstalling VB and reinstalling, running as Administrator, but the re-compiled EXE still gives the Runtime 91 error on startup.  I also tried setting VB Compatibility to Windows XP SP2 (and then 3) but this didn't seem to help either.  I'm not sure how to debug this error further.  Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Som TripathiDatabase Administrator

Commented:
Strange to hear that people are still working on Visual Basic 6.0. My favorite and lost friend...

I think, the reason might be references which is causing it. Check if you are adding any reference which is not found on target.
A simple debug method is this..
Note down all the Components and references used by your failing project. Say 16 items.
Create a new project and add 8 (half) of them and test the compile..
If OK, add 4 more and test again.. If fails, remove 4 etc..
It should only take a few tests to isolate what it is failing on..
Some of the DLLs your app uses haven't been registered correctly on the 64-bit machine.  There's a 32-bit version of REGSVR32.EXE in the folder C:\Windows\SysWOW64, you need to use this to register 32-bit DLLs.  (ie: C:\Windows\SysWOW64\REGSVR32.EXE MyDLL.dll)
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Author

Commented:
Thanks I will try that today.  I have two third party controls that may be the problem.
I recommend a points split between sommerville, BrianVSoft and judgeking.
LeeTutorretired
Top Expert 2009

Commented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Author

Commented:
My apologies for the delay.  I have tremendous respect for EE and did not intentionally abandon my question.  Personal reasons have kept me away...I do feel the information provided by the three Experts who took the time to respond will be useful.  Am I still allowed time to distribute the points to the three?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial