JDoshi JDoshi - 1 month ago 13
C# Question

.xltm file opens as .xlsx file

I am facing the issue while opening an Excel macro-enabled template(.xltm) file when I open from my application.

I have gone through this link which tells how the .xltm file opens. Here I want to override the orignal .xltm file so I need to open the same in .xltm format programatically in c#.

Below is code used to call the

Workbooks.Open
.

Globals.ThisAddIn.Application.Workbooks.Open(DisplayFile, false, false, Type.Missing, "", "",
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, 0)


However, it opens the file in Excel in .xlsx format only.

Need suggestions on what needs to be changed in calling the 'Workbooks.Open' method or any other method can be used.

Answer

Finally, after posting the same question on many places I got the answer !! Just need to set argument editable to True in the Workbooks.Open method.

Comments