I built a model that needs to run on a PC and on a Mac. One of the routines copies a sheet from the model to a new workbook and saves the new workbook. The following code runs fine on a PC, but the line that saves the file throws a "Method 'SaveAs' of Object" error on a Mac (last line). Does anyone know what I have to do get it work on a Mac?
Thank you!
VBA Code:
NewFileName = ThisWorkbook.Path & "\" & Format(Now, "yyyy.mm.dd") & "_" & "Invoice Payments_" & [SetupProjectName] & ".xlsx"
Set NewBook = Workbooks.Add
shtInvoicePayments.Copy Before:=NewBook.Sheets(1)
NewBook.SaveAs FileName:=NewFileName
Thank you!