Free Support Forum - aspose.com

Aspose.Words document locked for editing by another user

Hi,


Trying out Aspose.Words for Java (version 13.3.0).

Opening a document, making some modifications then saving to a new name using Document.save().

All seems to be working OK, except that when my program has completed and I then open any of the output documents in Word [2010], I get a message that they are “locked for editing by another user”, and I can only open them in read-only mode.

Is there an obvious reason for this - am I not closing/releasing the document properly in my Java app to cause it to remain locked?

Thanks

David

Hi David,


Thanks for your inquiry. Could you please create a simple Java application that demonstrates this problem and post it here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Yes, here it is.


import com.aspose.words.Document;

public class AsposeTest {

public static void main(String[] args) {

String filename = “C:/temp/foo.docx”;
String newfile = “C:/temp/new.docx”;

try {
Document doc = new Document(filename);
doc.save(newfile);
} catch (Exception e) {
}
}
}

Hi David,


Thanks for your inquiry. After an initial test with Aspose.Words for Java v13.3.0, I was unable to reproduce this issue on my side. Does this happen with one document in particular or all Word Documents you convert are opened in read-only mode in Microsoft Word? Could you please also attach your problematic document(s) here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hi,


I have done some more testing. I was using input and output directories in a VMware shared folder, and it seems to be this that caused the “document locked” issue. It does not happen when I create the output document in a local folder.

So, not an Aspose problem, but it seems to be some artifact of how VMware handles files in shared folders, so I will simply avoid using it that way.

Thanks for your help.

Hi David,


Thanks for your feedback. It’s great you were able to find what you were looking for. Please let us know any time you have any further queries.

Best regards,