• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sharing violation when file is shared by multiple user.

ThrottleWorks

Excel Ninja
Hi,

I have a macro. This macro file is in XLSB format.
Macro opens a file with XLSM format, process it, ‘Save as’ in XLSX format.
User opens this file, makes it ‘shared’, multiple users start working on this file.

However, when users tries to save ‘SHARED’ file, he cannot save it.

He gets a pop-up as ‘Your changes could not be saved to ‘dummy name.xlsx’ because of a sharing violation. Try saving to a different file.

I am using below mentioned code to save the file. Please note, issue does not occur when file is not shared with multiple users.

Can anyone please help me in this.

Code:
Sub Save_Report()
Dim MyPath As String
Dim MyReportName As String

MyPath = ThisWorkbook.Worksheets("Mapping").Range("A6").Value
MyReportName = ThisWorkbook.Worksheets("Mapping").Range("A4").Value
ActiveWorkbook.SaveAs Filename:=MyPath & "\" & MyReportName & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
 
Back
Top