Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all, it's important to know what you mean by "open an Excel file for reading and copy it to clipboard..."</p> <p>This is very important because there are many ways you could do that depending just on what you intend to do. Let me explain:</p> <ol> <li><p>If you want to read a set of data and copy that in the clipboard and you know the data format (e.g. column names), I suggest you use an <strong>OleDbConnection</strong> to open the file, this way you can treat the xls file content as a Database Table, so you can read data with SQL instruction and treat the data as you want.</p></li> <li><p>If you want to do operations on the data with the Excel object model then open it in the way you began.</p></li> <li><p>Some time it's possible to treat an xls file as a kind of csv file, there are tools like <a href="http://www.filehelpers.com/" rel="noreferrer">File Helpers</a> which permit you to treat and open an xls file in a simple way by mapping a structure on an arbitrary object.</p></li> </ol> <p>Another important point is in which Excel version the file is.</p> <p>I have, unfortunately I say, a strong experience working with Office automation in all ways, even if bounded in concepts like Application Automation, Data Management and Plugins, and generally I suggest only as the last resort, to using Excel automation or Office automation to read data; just if there aren't better ways to accomplish that task.</p> <p>Working with automation could be heavy in performance, in terms of resource cost, could involve in other issues related for example to security and more, and last but not at least, working with COM interop it's not so "free".. So my suggestion is think and analyze the situation within your needs and then take the better way.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload