Microsoft KB Archive/57200: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (X010 moved page Microsoft KB Archive/Q57200 to Microsoft KB Archive/57200 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/")
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
The following macro finds the filename of the active sheet and adds the extension as coded in the macro:
The following macro finds the filename of the active sheet and adds the extension as coded in the macro:


rename =SET.NAME(“size”,FIND(“.”,GET.DOCUMENT(1))) =SET.NAME(“active_name”,LEFT(GET.DOCUMENT(1),size)&“XLS”) =SAVE.AS(active_name, 1,"",FALSE) =RETURN()
rename =SET.NAME(“size”,FIND(“.”,GET.DOCUMENT(1))) =SET.NAME(“active_name”,LEFT(GET.DOCUMENT(1),size)&“XLS”) =SAVE.AS(active_name, 1,"",FALSE) =RETURN()


To save the file in a format other than normal, change the “XLS” string in the second SET.NAME() command and the second parameter of the SAVE.AS() command.
To save the file in a format other than normal, change the “XLS” string in the second SET.NAME() command and the second parameter of the SAVE.AS() command.


Copyright Microsoft Corporation 1993.
Copyright Microsoft Corporation 1993.

Latest revision as of 19:25, 12 August 2020

Extension Not Changing in Excel SAVE.AS() Command PSS ID Number: Q57200 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.x 3.00 | 2.20 2.21 3.00

WINDOWS | OS/2

Summary:

In Excel, you can use the SAVE.AS() function in a macro to change the format of an already existing file. If the filename (including the extension) is not specified in the name_text parameter, the extension of the file will not change. For example, if you have the text file TEST.TXT and using the SAVE.AS command save the file as a normal Excel file, the filename will remain TEST.TXT.

The following macro finds the filename of the active sheet and adds the extension as coded in the macro:

rename =SET.NAME(“size”,FIND(“.”,GET.DOCUMENT(1))) =SET.NAME(“active_name”,LEFT(GET.DOCUMENT(1),size)&“XLS”) =SAVE.AS(active_name, 1,"",FALSE) =RETURN()

To save the file in a format other than normal, change the “XLS” string in the second SET.NAME() command and the second parameter of the SAVE.AS() command.

Copyright Microsoft Corporation 1993.