A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Debbie
Replace these two lines
CSVPath = Template.Path & "" & CSVname
FlagPath = Template.Path & "" & Flagname
with
CSVPath = "C:\Users\debi.w\Documents\M Files" & "" & CSVname
FlagPath = "C:\Users\debi.w\Documents\M Files" & "" & Flagname
So try
***********************************************************************************
CSVname = "XXYY" & Format(Date, "YYYYMMDD") & "INTRADAY" & ".csv"
Flagname = "XXYYCOMPLETE." & Format(Date, "YYYYMMDD") & "NEW"
CSVPath = "C:\Users\debi.w\Documents\M Files" & "" & CSVname
FlagPath = "C:\Users\debi.w\Documents\M Files" & "" & Flagname
'''''''''''''''''''''' To Create and save the Flag excel and the CSV file '''''''''''''''''''''''''''''''''''''''''''
Set XLfile = Workbooks.Add
Set CSVfile = Workbooks.Add
With Template
ScrappedSh.Name = "XXYYCOMPLETE-" & Format(Date, "YYYYMMDD")
ScrappedSh.Name = "XXYY-" & Format(Date, "YYYYMMDD")
.Sheets(ScrappedSh.Name).Copy Before:=CSVfile.Worksheets("Sheet1")
ScrappedSh.Name = "Raw Data"
End With
XLfile.SaveAs Filename:=FlagPath, FileFormat:=xlOpenXMLWorkbook
XLfile.Close
CSVfile.SaveAs Filename:=CSVPath, FileFormat:=xlCSV
CSVfile.Close
************************************************************************************************
I hope this helps you
Regards
Jeovany