vb.net - Reading values from an Excel File -


I want to get a value from 12 Excel sheets. Is there any way that I get the price without opening the Excel sheet? I am using vb.net to post the example code, if there is any way of reading values ​​without opening the excel file. Thank you

You can not read values ​​without opening Excel files at all. But you can read the value without opening Excel.

If the file is saved in XML format it will be easy. If not, the easiest way is to still use Excel, but use Office Automation to do this. The hard way to create hard Excel file parsers is - difficult but still possible - on non-open XML Excel format (former Office 2003).

However, it is quite impossible to read from an Excel without opening a spreadsheet file ..

This is the snippet of code that you can get from VB. Can use a spreadsheet from the net to open, which takes advantage of Office Automation (it still opens the file, Excel Automation is dependent on DLL, but does not need to open Excel):

Disclaimer

is not intended to use the following code, but only this is a sample to direct the reader into its own solution, which is completely Should be tested from

  You get your VB code for the code below. You must add reference to the office interop assembly in the net. XlApp = New Excel.ApplicationClass xlWorkBook = xlApp.Workbooks.Open ("Your Excel spreadsheet file is here") xlWorkSheet = xlWorkBook.Worksheets ("sheet1") category = (if you do not know how to do Google search) Limit for range.Rows.Count = ccnt = 1 for XlWorkSheet.UsedRange rCnt = 1. Columns Obaj = CType (range.Cells (rCnt, cCnt), Excel.Range) 'Obj.value now contains value in cell. Next Next  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -