0

I need to read XLTM files without opening it.

With Excel interop, i can read but it will open the file too.

The below link shows reading xlsx file with OLDB. But same wont work for XLTM.

http://codehill.com/2009/01/reading-excel-2003-and-2007-files-using-oledb/

Is there any way i can read XLTM file with out opening the file it self.

Thanks in Advance.

Vijay Hulmani
  • 969
  • 8
  • 17

1 Answers1

1

You can definitely use the Excel interop assembly, just set visibility and screenUpdation off like :

Microsoft.Office.Interop.Excel.Application xltmApp = new Microsoft.Office.Interop.Excel.Application();
xltmApp.Visible = false;
xltmApp.ScreenUpdating = false;
Workbook xltmBook = xltmApp.Workbooks.Open(@"C:\test.xltm");
...do stuff

Then close document properly see: http://msdn.microsoft.com/en-us/library/h1e33e36.aspx

Also if you want you can turn off dialog boxes during saving see: Trying to exit C# Excel Workbook without a dialog box.

Community
  • 1
  • 1
pxm
  • 1,611
  • 2
  • 18
  • 34