PRB: File Not Found Error When Running .EXE on Other Computer

Last reviewed: June 21, 1995
Article ID: Q101580
The information in this article applies to:

- Professional and Standard Editions of Microsoft Visual Basic

  Programming System for Windows, version 3.0

SYMPTOMS

When you try to use the IIf function in Visual Basic version 3.0 for Windows, you receive a "File Not Found" error when you try to run your executable program on a separate computer that does not contain the file MSAFINX.DLL.

CAUSE

The "File Not Found" error occurs because the IIf function is not included in VBRUN300.DLL file but is located in the MSAFINX.DLL file.

RESOLUTION

To prevent the error, install the MSAFINX.DLL file on the customer's computer in the \WINDOWS\SYSTEM subdirectory.

MORE INFORMATION

Below is a list of all the financial functions in the MSAFINX.DLL file:

DDB          FV           IPMT         IRR          MIRR
NPER         NPV          PMT          PPMT         PV
RATE         SLN          SYD

Below is a list of all the date functions in the MSAFINX.DLL file:

DATE         DATE$        DATEADD      DATECREATED  DATEDIFF
DATEPART     DATESERIAL   DATEVALUE    DAVG         DAY

Below is a list of the other functions in the MSAFINX.DLL:

IIF          PARTITION

A "File Not Found" error occurs if you use any of the these functions in your program and then use the program on a computer that does not contain the MSAFINX.DLL file.

MORE INFORMATION

Steps to Reproduce Behavior

The following steps cause the "File Not Found" error in Visual Basic version 3.00 for Windows.

  1. Start Visual Basic (VB.EXE).

  2. Add a text box (Text1) and a label (Label1) to Form1.

  3. Enter the line of code on page 274 in the Language Reference manual:

       Sub Label1_Click ( )
          Label1.Caption = IIf(Val(text1.text) > 1000, "Large", "Small")
          '*** note you may want to add the Val statement for numbers
       End Sub
    
    

  4. Run the example and enter a number in the Text1 text box. Then click Label1 to see if the example works in the environment.

  5. From the File menu, choose Make Exe File... Name the executable IIFTEST.EXE. Save the project as IIFTEST.MAK, and save the form as IIFTEST.FRM.

  6. Copy the IIFTEST.EXE and VBRUN300.DLL files to a floppy disk.

  7. Take the floppy disk to a computer that does not have Visual Basic version 3.0 installed. Try and run the IIFTEST.EXE file from File Manager on that computer. You should get the "File Not Found" error.

  8. If you add the file MSAFINX.DLL to the floppy disk, and then run the IIFTEST.EXE file, no error will occur.


Additional reference words: 3.00
KBCategory: kbprg kbcode kbprb
KBSubcategory: PrgOther


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: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.