Microsoft KB Archive/78308

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a

-

SUMMARY
In Microsoft Excel, the FLATFILE.XLA add-in file supplies a macro that allows you to import data from a text file to a worksheet, and a second macro that allows you to export data from a worksheet to a text file. Normally these features are accessed from menu options that the add-in supplies. To run the data export macro from within a user-defined macro sheet, you must make a slight modification.

MORE INFORMATION
To execute the Data Export command from a user-defined macro, the following formula is used:

"=FLATFILE.XLA!MCP01.FixedFieldExport" To execute the Data Smart Parse command from a user-defined macro, the following formula is used: "=FLATFILE.XLA!MCP05.SmartParse" If you attempt to export data from a spreadsheet to a file by calling the FLATFILE.XLA data export macro from within a user-defined macro, the user-defined macro will halt. This is because the FLATFILE.XLA data export macro ends with a HALT statement rather than a RETURN statement. The HALT command prevents the data export macro from returning control to the macro that called it.

WORKAROUND
The HALT statement is contained on a cell of FLATFILE.XLA. You can replace it with a RETURN statement. Do the following:


 * 1) Hold the SHIFT key down as you open FLATFILE.XLA. This makes the file available for editing. If the file is hidden, choose Unhide from the Window menu and select it from the list.
 * 2) Select the cell containing the HALT statement. This will be on cell B47 in version 3.0, B82 in versions 4.0 and 4.0a.


 * 1) Replace &quot;=HALT&quot; with =RETURN.

You should make a backup of the original FLATFILE.XLA prior to making any changes.