Excel Err Msg: "Error Locating Support File..." with RANDOM()Last reviewed: September 12, 1996Article ID: Q96636 |
The information in this article applies to:
SUMMARYIn Microsoft Excel, you can use the RANDOM() function (available in the Analysis ToolPak add-in macro), to generate a set of random numbers. When you use this function in a macro, if you leave any of the optional arguments (variables, points, or seed) blank, you will receive the following error message:
An error has occurred locating a support file or processing data for an add-in procedure. MORE INFORMATIONUsing the RANDOM() function in a macro produces the same results as choosing Analysis Tools from the Options menu and selecting Random Number Generation from the list of available tools. Using the Options menu method, it is not necessary to specify a value in the Random Seed box. Microsoft Excel still generates a set of random numbers. In the RANDOM() function, the variables argument specifies the number of columns in the output range, the points argument specifies the number of rows in the output range, and the seed argument specifies an offset value used in determining which random numbers to retrieve. You must specify a value for each of these arguments when you use RANDOM() in a macro.
WorkaroundTo work around this problem, specify the three following arguments for the RANDOM() function:
For this argument Use this value ----------------------------------------- Variables COLUMNS(range) Points ROWS(range) Seed INT(RAND()*number) or any positive integer.The resulting formula will be
=RANDOM(cell,COLUMNS(range),ROWS(range),1,INT(RAND()*number),10,20)where "cell" is the upper left cell in the output range, range is the reference or defined name of the area on the worksheet where you want to place the random numbers, and number is the largest possible number you want to use as a seed value. Note: Using this formula, or a seed of 0, produces a different set of numbers each time you run the macro; using a constant such as 10 produces the same set of numbers each time you run the macro. The following sample macro demonstrates the use of the RANDOM() function using 5 and INT(RAND()*10) for the seed argument:
REFERENCES"Online Help," version 5.0 "Function Reference," version 4.0, pages 345-346 "User's Guide 2," version 4.0, pages 38-40
|
KBCategory: kberrmsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |