Microsoft KB Archive/101580

From BetaArchive Wiki

Article ID: 101580

Article Last Modified on 10/28/2003


  • Microsoft Visual Basic 3.0 Professional Edition
  • Microsoft Visual Basic 3.0 Professional Edition

This article was previously published under Q101580


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.


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.


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


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:


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


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: kbprb KB101580