Microsoft KB Archive/61950

Excel Macro to Toggle spooler= in WIN.INI PSS ID Number: Q61950 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.00 2.01 2.10 3.00

WINDOWS

Summary:

The following Excel command macro toggles the spooler= setting in the WIN.INI file from yes to no or from no to yes when activated.

More Information:

A1: ToggleSpooler A2: =ECHO(FALSE) A3: =FOPEN(“C:.INI”,1) A4: =NEW(1) A5: =ERROR(TRUE,A9) A6: =FORMULA(FREADLN(A3),ACTIVE.CELL) A7: =SELECT(“R[1]C”) A8: =GOTO(A6) A9: =ERROR(TRUE) A10: =SELECT(!$A$1) A11: =WHILE(LOWER(LEFT(ACTIVE.CELL,7))<>"spooler")  A12: =SELECT("R[1]C")  A13: =NEXT  A14: =IF(LEN(ACTIVE.CELL)=11,FORMULA(LEFT(ACTIVE.CELL,8)  &"no"),FORMULA(LEFT(ACTIVE.CELL,8)&"yes"))  A15: =LEN(ACTIVE.CELL)  A16: =SELECT(!$ A$1) A17: =FPOS(A3,1) A18: =WHILE(NOT(ISBLANK(ACTIVE.CELL))) A19: =FWRITELN(A3,ACTIVE.CELL) A20: =SELECT(“R[1]C”) A21: =NEXT A22: =FCLOSE(A3) A23: =SEND.KEYS(“{TAB}{ENTER}”) A24: =CLOSE A25: =IF(A15=10,ALERT(“Spooler has been turned off. Restart Windows for this option to take effect.”,1)) A26: =IF(A15=11,ALERT(“Spooler has been turned on. Restart Windows for this option to take effect.”,1)) A27: =RETURN

This macro assumes that WIN.INI is in the C:directory. If WIN.INI is located in a different directory, change cell A3 accordingly. When activated, the macro checks the spooler= entry of WIN.INI and toggles it between yes and no, turning the spooler on or off. Windows (Excel, etc.) must then be restarted for the WIN.INI change to take effect.

Copyright Microsoft Corporation 1993.