0

I have a macro enabled excel template (.xlsm) that I have uploaded into a Document library ( as a file not as a document template) .

These templates will be used by other employees of the company from a link provided in a site page in the same site.

When the link is clicked the file will be opened in the Excel in the client machine. The template has a button to save to a different location in a Shared drive but if they click save from the File menu, it will overwrite the copy in the library which I do not want to happen.

I have given Read only permission for all users except the Site Owners , who need to be given full control so they can directly upload a new template when ever required. But in doing, If the owners accidentally click on the save button it will overwrite the template in the library. Is there a way i can prevent this from happening and make the template open as a new copy of the file.

I tried using CreateNewDocumentWithProgID and ViewDoc methods, but these were unsuccessful , The "CreateNewDocumentWithProgID" was unsuccessful because I get a VBA error 400 when trying to save using the button added in the template.

The ViewDoc method failed because it worked same as the "EditDocumentWithProgID2" method and the file could be edited.

Am I Doing something wrong or is this not possible to implement.?

Please advice. Thanks in Advance.

0

Normally a "template" in SharePoint is used as a document template for a Content-Type on a document library. The users don't open the template document directly, they create a "New" document of the Content-Type and gets a copy of the template.

Check How to create a Content Type which refers to a template located in your SharePoint sites (user option C).

  • I am aware of this. But I do not want the generated files to be saved in Sharepoint and we have multiple such templates uploaded in the same library for ease of use. – mallu coder Aug 8 '16 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.