UPD: Invalid file format Error When Run VB app's EXE File

Last reviewed: September 17, 1997
Article ID: Q101261
3.00 WINDOWS kbprg kbfile kbfixlist kbbuglist

The information in this article applies to:

- The Microsoft Visual Basic programming system for Windows, version 3.0

SYMPTOMS

You may encounter the following error when running a Visual Basic executable (EXE) file:

   Invalid file format

Or you may encounter the following error when loading a Visual Basic project or form:

   Error loading '<form filename>'. A control could not be loaded due
   to a load error. Continue?

CAUSE

This problem will occur when you have installed a new version of a custom control and the internal property list of the control has incorrectly changed in a way that breaks backward compatibility.

This problem is known to occur when you have installed the Visual Basic version 3.0 GRID.VBX file over an earlier version of the grid. Specifically, the problem will occur for an existing Visual Basic application, built using a previous version of the grid, that sets the HelpContextID property of the grid.

In the case where the problem occurs when you load a project into Visual Basic that contains a grid, the problem will only occur when the form file(s) containing the grid have been saved in binary format.

This problem is also known to occur when using Visual Basic version 2.0 and the CMDIALOG.VBX control. For more information on this problem, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: Q100611

TITLE     : FIX: VB 2.0 Prof Demo Causes Error: Invalid File Format

WORKAROUND

There are several ways that you can work around this problem:

If you are using a Visual Basic version 3.0 application and you encounter this problem, you can:

  • Acquire an updated copy of GRID.VBX from Microsoft (see instructions in the More Information section below).
  • Replace the Visual Basic version 3.0 of GRID.VBX with an earlier version. A disadvantage of this strategy is that applications requiring the Visual Basic version 3.0 grid will not run.

If you are a developer of a Visual Basic version 3.0 application that uses the grid, you can:
  • Acquire an updated copy of GRID.VBX from Microsoft (see instructions in the More Information section below). You will need to build your application using this grid.
  • Rename GRID.VBX to a different name such as MSGRID3.VBX and rebuild the application using the renamed grid. A disadvantage of this strategy is that the grid will not be automatically updated when a new version of the grid (such as a version of the grid containing bug fixes) is released.

The following shows the date, time, size, and version number of the GRID.VBX file that leads to this problem:

  Date: 28-APR-1993
  Time: 12:00 a.m.
  Size: 44667
  Version: Not Marked

The following shows the date, time, size, and version number of the GRID.VBX file that fixes this problem:

  Date: 15-JUNE-1993
  Time: 5:26 p.m.
  Size: 45136
  Version: 03.00.0538

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. The problem is corrected by the updated version of GRID.VBX.

MORE INFORMATION

How to Obtain Updated Copy of GRID.VBX

To obtain the updated copy of GRID.VBX, download VBGRID.EXE, a self-extracting file, on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
    
          Enter kbfile VBGRID.EXE (size: 41336 bytes) 
                                 , and click GO!
          Open the article, and click the button to download the file
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get VBGRID.EXE (size: 41336 bytes) 
    
  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location
          Type "mssupport" (without the quotation marks)
          Double-click the MS Software Library icon
          Find the appropriate product area
          Locate and Download VBGRID.EXE
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download VBGRID.EXE (size: 41336 bytes) 
    

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

Steps to Reproduce Problem

  1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. Add a Visual Basic version 1.0 or 2.0 version of GRID.VBX to Form1.

  3. Put a grid control (Grid1) on Form1

  4. Set the HelpContextID property of Grid1 to 1 (or some non-zero value).

  5. From the File menu, choose Make EXE File (ALT, F, K) and create an EXE called PROJECT1.EXE.

  6. Replace the older version of grid with the Visual Basic version 3.0 version of GRID.VBX, which has a date and time of 28-APR-1993 12:00 am.

  7. Run the PROJECT1.EXE file created in step 5.

You should encounter an "Invalid file format" error. If you replace the Visual Basic version 3.0 grid with the version of the grid used in Step 2 and re-run PROJECT1.EXE, the program should run correctly.


Additional reference words: 3.00 softlib update3.00 S14643
KBCategory: kbprg kbfile kbfixlist kbbuglist
KBSubcategory: PrgCtrlsStd
Keywords : PrgCtrlsStd kbbuglist kbfile kbfixlist kbprg
Version : 3.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.