Solved

.xltm file opens as .xlsx file

Posted on 2016-10-24
3
36 Views
Last Modified: 2016-10-24
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 "http://stackoverflow.com/questions/21850650/issue-with-excel-template-fileswhich"  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.
0
Comment
Question by:Jeet Doshi
3 Comments
 
LVL 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
When I understand you correctly: That's normal.

A template is "generated" when you save an Excel document by saving it as template. When opened in Excel it behavces like a "normal" workbook.
0
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
Hi,

pls try to change the argument Editable to true to be able to change the template

Regards
0
 

Author Closing Comment

by:Jeet Doshi
Comment Utility
Its working after setting editable = true!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now