Nilz
11-11-2014, 03:28 AM
Hey guys,
Having a little trouble with this; I just want to save a read-only copy of a file in a different folder with todays date but for some reason I cant figure out whats wrong with this code, it saves the file name with "dt" and not the actual date? (help would be really appreciated!)
Sub Readonly()
' SaveAsReadOnly Macro
Dim dt As String
dt = Format(Now, "yyyymmdd")
ChDir "G:\Capital Markets\Tools\DS"
ActiveWorkbook.SaveCopyAs Filename:= _
"G:\Capital Markets\Tools\DS\Spreads & dt.xlsb"
SetAttr "G:\Capital Markets\Tools\DS\Spreads & dt.xlsb", vbReadOnly
End Sub
Having a little trouble with this; I just want to save a read-only copy of a file in a different folder with todays date but for some reason I cant figure out whats wrong with this code, it saves the file name with "dt" and not the actual date? (help would be really appreciated!)
Sub Readonly()
' SaveAsReadOnly Macro
Dim dt As String
dt = Format(Now, "yyyymmdd")
ChDir "G:\Capital Markets\Tools\DS"
ActiveWorkbook.SaveCopyAs Filename:= _
"G:\Capital Markets\Tools\DS\Spreads & dt.xlsb"
SetAttr "G:\Capital Markets\Tools\DS\Spreads & dt.xlsb", vbReadOnly
End Sub