Link to home
Start Free TrialLog in
Avatar of esmyhs
esmyhs

asked on

Failed to load control 'MSFlexGrid' from MSFlxGrd.Ocx.

I have been using VB6 for a long time. A while back I started getting the following message when opening up projects in VB6 that contain a FlexGrid:

Failed to load control 'MSFlexGrid' from MSFlxGrd.Ocx. Your version of MSFlxGrd.Ocx may be outdated. Make sure you are using the version of the control that was provided with your application.

I have tried unregistering and reregistering msflxgrd.ocx. I tried reinstalling Service Pack 6. The project runs fine in VB6, but I'm not sure why I am getting this error.

Any advice?
Avatar of Jan Vojtech Vanicek
Jan Vojtech Vanicek
Flag of Czechia image

try to remove the component from project and add it again.
if it is not work you can try to edit the vbp file in notepad and delete the line

Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX

and save it

ope project in VB and add the control again, and try
Avatar of esmyhs
esmyhs

ASKER

Trying your first solution gives me the following error (since I am using the control on multiple forms):
Can't remove control of reference; In use

The second solution doesn't seem to fix the problem either.
It is doing the same?

you can try one more thing:
open new project and add the flexgrid here, save it

open the vbp file in notepad and copy the flexgrid object line to your project... can you paste the old one project file here please?
Avatar of esmyhs

ASKER

When I try to add a FlexGrid to a new project it adds fine to the form. When I try to run the project, it gives me an "Unexpected Error". When I Click OK it gives me the following error:

Error loading 'C:\DOCUME~1\USER\LOCALS~1\Temp\VB1D3.tmp'. A control could not be loaded due to load error. Continue?

When I click ok, it shows me the form with the FlexGrid in red.

I don't believe that the problem is with my project because I get the other error in all of my projects that have a FlexGrid in them. It must be something with the control.
what do you use as operating system?

If you are using vista or 7, run the VB as administrator (right click on icon of VB and click run as administrator) even if you administrator already. This can be caused by UAC

and/or

Go to that directory and see whats wrong - security etc.. Best way is to delete all files there ;-) and check the directory settings
Avatar of esmyhs

ASKER

I am using Windows XP. I don't know if it makes a difference but I also have Visual Studio 2008 installed.
It is no problem with VS2008 I have the same configuration and flexgrid Im using almost every day. What about the security in temp folder?
Avatar of esmyhs

ASKER

I erased everything in the directory. Still no good.

I'm not sure what you mean by security. Nothing has been changed as far as I remember.
if you click on the tem directory by right button, there is properties and tab security. ensure that you have full access to it
Avatar of esmyhs

ASKER

There is no Security Tab in properties on the Temp folder.
are you using FAT or NTFS filesystem?
Avatar of esmyhs

ASKER

NTFS
maybe you have turned on the easy filesharing or you have XP home edition... This setting is in options where you can show hidden files and so on...
Avatar of esmyhs

ASKER

I have XP Home.
You can try to do chkdsk of your disk, maybe there is something corrupted... I thing problem resides in the tmp file that cant be modified or deleted
Avatar of esmyhs

ASKER

Chkdsk did not fix the problem.
It may be that Microsoft is the culprit. Check the "Microsoft Critical Update KB960715". This update prevents Active X controls from working. In Control Panel / Add Remove Programs (show updates), go to the update, then click on the link to get to the Microsoft site. The explanation is there, along with some remedies.

Leon
Avatar of esmyhs

ASKER

I don't have "Microsoft Critical Update KB960715" installed.
Its not the only one that is known to do this.

Leon
Avatar of esmyhs

ASKER

Do you know of a way to narrow it down?
ASKER CERTIFIED SOLUTION
Avatar of leonstryker
leonstryker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of esmyhs

ASKER

I've tried all of the solutions at http://www.tek-tips.com/viewthread.cfm?qid=1530759, and it still doesn't work.

I get the same error as before, when opening a project that has a Flexgrid on one if the forms.

If I add a FlexGrid to a new form (in a new project) and try to run it, I get an "Unexpected Error".
Do you have another PC to test the VB code on?

Leon
Avatar of esmyhs

ASKER

The VB Code works fine on another computer.
Then its definently a machine specific problem as described above, although chasing it down will mostly like proove to be impossible.

Leon
Avatar of esmyhs

ASKER

Do you think uninstalling and reinstalling VB will do anything to help?
There is a very, very small possibility that it will. But, I think the issue is outside VB or VB code.

Leon
Avatar of esmyhs

ASKER

Unistalling and reinstalling VB did not work. I also tried to extract the flexgrid.ocx from the SP6 upgrade. That didn't work either.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No problem. I do not care about the points but lets not delete the question.

Leon
Avatar of esmyhs

ASKER

I am not trying to delete the question. I just wanted it to be closed. I would love to give the points to you, because you've been very patient. I just don't want to accept something as the solution that wasn't, because I don't want to mislead someone else who might have the same problem.
Thats fine, this question can be closed with your post 25894363 as a solution. Is that ok?
Avatar of esmyhs

ASKER

If there is a way to close it with my post as the solution and your post 25809062 as the assisted solution (with the points assigned to you), that would be ok as well.