Customize Save As dialog for saving Template

Add-in Express™ Support Service
That's what is more important than anything else

Customize Save As dialog for saving Template
 
nitin c




Posts: 79
Joined: 2007-05-18
Hi,

I have a template which uses my UDFs, I add this template to my existing workbooks using the code :

Excel.Workbook workBook = excelApp.Workbooks.Add(destinationTemplate);

and then the UDFs execute, now when the user hits Ctrl-S, Excel shows a filename (Same as the template name without extension and "1" appended to it) and the type is shown as ".xls" however when we save, the file does not get .xls extenstion.

Any idea whats going wrong? or how should I work with tempaltes?

- Nitin
Posted 29 Jun, 2007 09:13:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nitin.

Please send me the code. I will test it.



P.S. We always do our best to answer your forum requests as soon as
possible. However, we apply the rule "first in first out" with Premium
Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found.
Posted 29 Jun, 2007 17:21:53 Top
nitin c




Posts: 79
Joined: 2007-05-18
Hi Sergey,

How should i send u this code? your email address?
Its a pretty simple thing..u can try out at your end.

Create a new ADX project have a UDF as follows
public string Foo()
{
return "Foo";
}

and the following in AddinModule.cs

private void AddinModule_AddinStartupComplete(object sender, EventArgs e)
{
try
{
Excel.Workbook workBook = ExcelApp.Workbooks.Add("Foo.xlt");
}
catch (Exception)
{

}
}

Now run this addin, it will add try to add the template in the existing workbook, once added save it. See how the save as dialog appears, and once save see if the file gets an extension (it does not).

I want to save the file with an extension.
Posted 02 Jul, 2007 11:53:40 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nitin.

I have just tested the code. It works fine. I get a new workbook with the .xls extension.
Posted 03 Jul, 2007 15:39:36 Top
nitin c




Posts: 79
Joined: 2007-05-18
Could you please send me your code at nitinatpspl@gmail.com

Also I noticed that if we remove the double quotes around filename while saving then it gets proper extension.
Posted 04 Jul, 2007 02:06:12 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nitin, my code is the same. But I tested it with my own template created in Excel 2003.
Posted 04 Jul, 2007 07:18:56 Top