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

ID: Q101580


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions 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.

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 query words: 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.