Excel 2007 Open API issue.

W

Weipeng

Hi Experts,

There is an issue for Excel 2007 Open API.

I save a template file(xltx), which has password for open and modify.
When I open this file by Open API, it did not open this template file but
create a new file with this template. I also passed the true for "Editable"
parameter.

About "Editable" Parameter, MSN said that "If the file is an Excel template,
True to open the specified template for editing. False to open a new workbook
based on the specified template. The default value is False."


The following is the code snapshot

try
{
Excel.Workbooks wbs = m_elApp.Workbooks;
if (wbs != null)
{

object missing = System.Reflection.Missing.Value;
string fileName = @"D:\sample.xltx";
object editable = true;
Excel.Workbook wb = wbs.Open(fileName,
missing, missing,
missing, missing,
missing, missing,
missing, missing,
editable, missing,
missing, missing,
missing, missing);
}
}
catch (Exception ex)
{

}

Hope someone can solve my problem!

Thanks for your help.

Weipeng
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top