Posted 12 May 2008 - 02:05 AM
Try this code:
fileI = ActiveSheet.Cells(1, 1).Value
FileN = fileI + ".xlsm"
ActiveWorkbook.SaveAs Filename:=FileN, FileFormat:=52
Filefomat = 52 means file type is Open XML Workbook Macro Enabled. Excel2007 wont let you save the workbook in any other fomat since it contain a macro.
About the button part, I would suggest having a keyboard shortcut when you write this macro.e.g if Ctrl+T is your shortcut,
once you type Ctrl T, the current workbook will be saved to A1value.xlsm.
If you also want to close the file as soon as you save, add one more line to the code
activeworkbook.close savechanges:= true
Hope this helps.