\r\n\r\n
Interoperation / Office Integration Topics include: COM, P/Invoke (e.g. Win32 API), marshaling, distributed applications, VBA and interacting with office apps

Go Back  Xtreme .NET Talk > .NET > Interoperation / Office Integration > reading excel data


\r\n \r\n \r\n \r\n
 
 
Thread Tools Display Modes
\r\n \r\n
\r\n
\r\n \r\n Hello,
\r\nI have the following code to read excel data from my VB.Net application.
\r\n
\r\nDim oXLApp As Excel.Application
\r\noXLApp = New Excel.Application()
\r\noXLApp.Workbooks.Open("fileName")
\r\n
\r\nAnd now I try to access a cell as
\r\n\'Line 1
\r\noXLApp.Range("cell1").Row where cell1 = cell name
\r\n
\r\n
\r\nSuppose, I change the cell name from cell1 to cell2 in my excel file, even then Line 1 executes correctly. I thought it would throw an exception because I have changed the cell name.
\r\n(Observation : In the excel file, I get a drop down in the name field just below the save button, it contains all the names that I have entered for the cells. And the above line works fine for all the names in the drop down, albeit some of the names are not being used by any cell)
\r\n
\r\nAm i missing something when using cell names instead of A-1 style way of accessing cells ??
\r\n
\r\nShankar\r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[353963] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 02-06-2003, 05:14 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n mhpo\r\n mhpo is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 01-15-2003, 03:05 PM
shankar shankar is offline
Newcomer
 
Join Date: Dec 2002
Posts: 12
shankar is on a distinguished road
Default reading excel data

Hello,
I have the following code to read excel data from my VB.Net application.

Dim oXLApp As Excel.Application
oXLApp = New Excel.Application()
oXLApp.Workbooks.Open("fileName")

And now I try to access a cell as
'Line 1
oXLApp.Range("cell1").Row where cell1 = cell name


Suppose, I change the cell name from cell1 to cell2 in my excel file, even then Line 1 executes correctly. I thought it would throw an exception because I have changed the cell name.
(Observation : In the excel file, I get a drop down in the name field just below the save button, it contains all the names that I have entered for the cells. And the above line works fine for all the names in the drop down, albeit some of the names are not being used by any cell)

Am i missing something when using cell names instead of A-1 style way of accessing cells ??

Shankar
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading Excel File using Excel Object and C# Eng Interoperation / Office Integration 8 07-29-2009 09:33 AM
Reading from an excel sheet man_luck Interoperation / Office Integration 0 09-14-2004 01:36 AM
Reading Excel is very slow John_0025 Interoperation / Office Integration 1 06-15-2004 06:14 AM
JET Engine Bug when reading excel data? Eng Interoperation / Office Integration 1 05-07-2004 12:30 AM
Reading from an excel file Neutrino Interoperation / Office Integration 1 06-20-2003 06:17 PM

Advertisement:

Powered by liquidweb