office-interop

Disposing of Microsoft.Office.Interop.Word.Application

大兔子大兔子 提交于 2019-11-26 04:23:42
问题 (Somewhat of a follow on from the post (which remains unanswered): https://stackoverflow.com/q/6197829/314661) Using the following code Application app = new Application(); _Document doc = app.Documents.Open(\"myDocPath.docx\", false, false, false); doc.PrintOut(false); doc.Close(); I am attempting to open and print a file programmatically. The problem is each time I run the above code a new WINWORD.exe process is started and obviously this quickly eats up all the memory. The application

Reading Datetime value From Excel sheet

空扰寡人 提交于 2019-11-26 02:08:34
问题 when am trying to read datetime type value from excel sheet it is returning a double value.for example if want to read value \'2007-02-19 14:11:45.730\' like this, i am getting a double type value .further i am converting this double value using timespan,but not complete successfully because i am getting only this value \'2007-02-19 12:00:00 AM\' now i want exact same datetime value as first one. My code is like :- TimeSpan datefromexcel = new TimeSpan(Convert.ToInt32((range.Cells[rCnt, cCnt]

Can I still use Microsoft.Office.Interop assemblies with office 2013?

旧城冷巷雨未停 提交于 2019-11-25 23:54:54
问题 I had to import an older project (in .Net 2) into Visual Studio 2013, it makes use of the Microsoft Primary Interop Assemblies. Visual Studio said that I need to add references to the project. Now I went and did some reading and apparently Microsoft has only released the PIA for office 2010? (I have Office 2013) Now what I would like to know is. Can I get it to work with office 2013 and be backward compatible? And if so is this a good route to go for the future? Is it going to be compatible?