Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am somewhat familiar with macros and understand how to record one. I am
using Excel 2007. I am trying to create a macro: (file, save as, "file name", and then have Excel finish with the "save" function), but I keep getting the following error message. Please help! Thanks. "the following features cannot be saved in macro-free workbooks: VB project. To save a file with these features, click no and then choose a macro enabled file type in the file list. To continue saving as a macro-free workbook click yes." I have already chosen "enable all macros" in the trust center. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I figured it out! Now I need to know how to name the file a different name
than the original and save it as a new one. Does anyone know the code for this? Thanks. "Rita" wrote: I am somewhat familiar with macros and understand how to record one. I am using Excel 2007. I am trying to create a macro: (file, save as, "file name", and then have Excel finish with the "save" function), but I keep getting the following error message. Please help! Thanks. "the following features cannot be saved in macro-free workbooks: VB project. To save a file with these features, click no and then choose a macro enabled file type in the file list. To continue saving as a macro-free workbook click yes." I have already chosen "enable all macros" in the trust center. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think you're probably already there! The same .SaveAs function also
accepts a new filename: ActiveWorkbook.SaveAs _ Filename:="C:\Users\JLatham\Documents\NewName.xlsm ", _ FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False And you can substitute a variable for the filename, allowing you to generate one before executing the command. Assuming you want to put it into the same folder with the original you can get the original path from the workbook's .FullName filePath=Left(ThisWorkbook.FullName, _ InstrRev(ThisWorkbook.FullName,Application.PathSep arator)) and build up some new name: NewName = "MyNewFileName_" & Year(Now()) & Month(Now()) & Day(Now()) & ".xlsm" 'put the two together NewName = filePath & NewName Then execute your .FileSave using NewName for the Filename:= parameter, as: Filename:=NewName "Rita" wrote: I figured it out! Now I need to know how to name the file a different name than the original and save it as a new one. Does anyone know the code for this? Thanks. "Rita" wrote: I am somewhat familiar with macros and understand how to record one. I am using Excel 2007. I am trying to create a macro: (file, save as, "file name", and then have Excel finish with the "save" function), but I keep getting the following error message. Please help! Thanks. "the following features cannot be saved in macro-free workbooks: VB project. To save a file with these features, click no and then choose a macro enabled file type in the file list. To continue saving as a macro-free workbook click yes." I have already chosen "enable all macros" in the trust center. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions |