Help for VBA code Excel 365 Mac

whiston

New Member
Joined
Aug 6, 2020
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
  2. Mobile
Hi, I use to run the following code on my excel 2016 Mac with no issue.

Sub SaveInvWithNewName()
Dim NewFN As Variant
PostToRegister
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "/Users/Whiston/Documents/Aarden Asia/AA2020/Inv 20-" & Range("C9").Value & " " & Range("B3").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub

However, after upgrading to a new Mac and Excel 365, I haven't be able to run the macro.

"Run-Time error "1004"

Your changes cannot be saved to "INV 20-xxx.xlsx"because of sharing violation. Try saving to a different file"

"I think the issue might be that I am saving directly to the iCloud Drive and not the stated path in the code.

thanks for the advise.
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Watch MrExcel Video

Forum statistics

Threads
1,118,361
Messages
5,571,726
Members
412,415
Latest member
NitinPanjwani
Top