Blog

Solution to VB and VBA problems using the FlexGrid

Solution to VB and VBA problems using the FlexGrid

Earlier in 2009, Microsoft declared the old FlexGrid control that came with VB6 a security threat. A security patch banned its use.

FlexGrid was an ActiveX control that was commonly distributed with many applications including Office. It has been widely used in Office macros. In fact, that is where this action by Microsoft caused problems at DMC. We have an automated proposal template system that uses FlexGrid.

The solution is to replace the FlexGrid with a new version that MS approves, or to install the Service Pack 6 for Visual Studio (if you have VS6 installed).

The fix also involves deleting a bunch of temp files that are lying around the PC.

  1. If you have VB6 on your PC, then install this VB 6 Service Pack 6 from Microsoft. Afterwards, restart your computer.
  2. If you don't have VB6 on your PC, then copy this msflxgrd.ocx file (unzip/extract the .ocx file first) into your c:\windows\system32 folder.
    1. Unregister the file with the command
      regsvr32 /u msflxgrd.ocx
    2. Re-register the file with the command
      regsvr32 msflxgrd.ocx
  3. Now clear away a number of Microsoft Temp files that are sill causing problems. Close most of the applications you are running and issue this command:
    1. BE SUPER CAREFUL HERE. (If you add an extra space to this command at the wrong place you will delete EVERYTHING on your C: drive!)
    2. del c:\*.exd /s

That's it: you can use the the FlexGrid again!

Here are a couple helpful articles I found on the subject:

Article 1

Article 2

Download the msflxgrd.ocx file

Comments

TurronK
# TurronK
Thanks a lot Ken.

It worked fine to me. My issue was solved following your procedure.

8-))

Cheers!
kulkarni
# kulkarni
Hi,

I am not able to solve this problem yet after doing all the procdures above . I am keen on using Msflexgrid and datagrid view controls in Excel VBA 2010. But no way I am able to do this. Can You please give some clue on this.

Regards,
CDK

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above: