Microsoft KB Archive/48144

{|
 * width="100%"|

Batch Printing of Files from Excel

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a
 * Microsoft Excel for the Macintosh, versions 2.x, 3.0, 4.0

-

SUMMARY
The following macro prints a batch of files that are all found in the same directory. It requests a directory name and then prints all the files in that directory.

  A1: Batch Print A2: =INPUT(&quot;Input the Directory of the files to print&quot;,2,&quot;Batch       Print Directory&quot;) A3: =DIRECTORY(A2) A4: =COLUMNS(FILES(&quot;*.xl?&quot;)) A5: =FOR(&quot;count&quot;,1,A4,1) A6: =OPEN(INDEX(FILES(&quot;*.xl?&quot;),count),FALSE,FALSE) A7: =PRINT A8: =CLOSE A9: =NEXT A10: =RETURN If you are using Microsoft Excel for the Macintosh, you need to change lines A4 and A6 as follows: 

  A4: =Columns(files(&quot;:*&quot;)) 

  A6: =Open(Index(Files(&quot;:*&quot;),count),false,false) If the directory contains more than 20 files and you are using versions of Microsoft Excel with Microsoft Windows 2.x or the run-time Microsoft Excel, the spooler should be disabled through the WIN.INI file by setting spooler=no. If you are using Microsoft Windows 3.0 or greater, remove the check in the Use Print Manager check box in the Printers dialog box in the Microsoft Windows 3.0 Control Panel.

Additional query words:

Keywords :

Version :

Platform :

Issue type :

Technology : kbvcSearch