I use the code below to save a file. What I need is the filename to change. I have a variable name: SalesOrderNum, and I would like to save this in a format: [SalesOrderNum]_lines.xlsx
How would I change the myFileNameO to save file correctly? Then later in the procedure I need to open it back up. How would in use the same myFileNameO or variable [SalesOrderNum] to reopen the file when needed? Please advise and thanks.
myDirECTorY = "C:\temp\" 'Wherever you want
myFileNameO = myDirECTorY & Format(Now(), "yyyymmdd_hhmm") & " report" & ".xlsx"
ActiveWorkbook.SaveAs Filename:=myFileNameO, FileFormat:= _