views:

286

answers:

2

Hi,

i want to have a "one-click" excel export feature for my application. I therefore need to create an excel file in a temporary location, because i need to use a third-party component to do so.

I want Excel then to open up the file. I can get to that point, however Excel always remembers the location it loaded the file from. Id like the loaded file to appear as a "new" file which is not saved to a specific location, so when the user wants to hit "save" (not save as) or close Excel it reminds them of unsaved changes.

Im using Excel Automation from c# .net 3.5

A: 

Hmm... try creating and excel template instead and then open the template instead?

Jimmy Chandra
+3  A: 

You can specify any existing Excel workbook as the template. Then you use the Workbooks.Add method to open a new workbook, with the Template parameter pointint to the temporary template.

GvS