is there a simple way in vb.net to load an excel file and read it? perhaps there is a way to load the file but have it not be visible to the user?
相关问题
- 'System.Threading.ThreadAbortException' in
- Excel sunburst chart: Some labels missing
- how to use special characters like '<'
- Error handling only works once
- Excel formula in VBA code
相关文章
- vb.net 关于xps文件操作问题
- Checking for DBNull throws a StrongTypingException
- Get column data by Column name and sheet name
- Using the typical get set properties in C#… with p
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Load a .NET assembly from the application's re
- C# equivalent of VB DLL function declaration (Inte
You can use ado.net to read from excel spreadsheets via the OLEDB JET 4 provider
This just opens the excel file as a file stream instead of opening the actual excel spreadsheet.
Alternatively you could use com-interop and simply set the application object visible property to false.
See http://www.connectionstrings.com/excel
One gotcha to watch out for when using .net and com interop with any office application is that if you try opening the application as a user who is more of a windows service than an actual human user then you will need to login to windows as that user and open the relevant application as that user so that all the registry entries are correctly updated for certain features of the office application.
If you have a more simple (ie small) excel spreadsheet that does not need to be dynamic, I think you could export it as a comma delimited file and then use a loop and streamreader object to parse each comma seperated value into an array.
Kinda round about though...
Alex - here is some old code I dug up to query excel. Pretty basic scenario here. Don't pay attention to the poor error handling and lack of the 'Using' construct.
Work with the Excel Object Model directly from .NET.