I am running some code to save a worksheet to its own excel file. What is the syntax to allow the path to be generic, to save the file to the working directory, where the excel workbook file is located. In this example the workbook is in the directory "Excel Dashboard". What if the directory I want to save to is one folder below the working directory, "Excel Dashboard\Invoices"?
Sub SaveInvWithNewName()
Dim NewFN As Variant
ActiveSheet.Copy
NewFN = "D:\Documents\Dropbox\Excel Dashboards\Inv" & Range("F3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
I am writing the program on Win 7, but it will also be used on a Mac, will the syntax for the path need to be different?
Bookmarks