I've been searching the posts (seems like a question that would be recurring), but I can't find an answer...
I have an excel workbook that contains a list of file names in a hidden column (ak). I am using the following code (worked great in Excel 2003), but it doesn't work quite right in excel 2007. When it replicates the file, I wanted it to save as a .xlsx or .xls that is macro free so the user doesn't get a warning message when it opens up...
Thank you in advance for you help!
Note: Example filename in column AK = JohnDoe123.xls
I have an excel workbook that contains a list of file names in a hidden column (ak). I am using the following code (worked great in Excel 2003), but it doesn't work quite right in excel 2007. When it replicates the file, I wanted it to save as a .xlsx or .xls that is macro free so the user doesn't get a warning message when it opens up...
Thank you in advance for you help!
Note: Example filename in column AK = JohnDoe123.xls
Code:
Sub A_File_Replication()'This macro replicates a file based on a list.- Module 2
'List should be located in a hidden column AK of the active sheet
'Update n = 2 to 98 to list lenghth (i.e., 100 file names in cells
'AK1 to AK100) then n = 1 to 100
'Create the folder C:\MACROS\FILES on your hardrive before running from
'the active sheet with the files listed in column AK
ActiveWorkbook.Save
Dim x As String
For n = 1 To 122
x = ActiveWorkbook.ActiveSheet.Range("AK" & n).Value
ActiveWorkbook.SaveAs ("C:\MACROS\FILES\" & x)
Application.DisplayAlerts = TRUE
Application.ScreenUpdating = True
Next n
End Sub