473,473 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parsing Excel Spreadsheet

Hello Everyone and thanks for your help in advance. I am
working on an application that requires the parsing of an
Excel spreadsheet that will be loaded into a SQL Server
table. An example of the spreadsheet is located at:

http://ratesheets.sollen.com/script/...ts/interfirst/
ratesheets/IFRS1_20030722_094227.xls

At the heart of the problem is the sometimes varying
layout of the spreadsheet. For example, the application
requires that the date between cells H13 and D23 be
loaded into the table. However, the same data may be
located between H12 and D22 tomorrow. So the application
needs to be able to determine the starting point of the
data. Fortunately, the headings do not change, so one of
the obvious ways to handle this is to move through each
cell (i.e. A1, A2, B1, B2) until the known header value
is achieved. However, this seems to be a very
inefficient way to handle this. Is there another way to
identify the starting point to begin processing, i.e. in
English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.
Jul 19 '05 #1
7 6001
Excel has a find function. You can use that to set the active cell to the
cell containing the desired text.

Colin

"Hugh McLaughlin" <hu**@kmcnetwork.com> wrote in message
news:05****************************@phx.gbl...
inefficient way to handle this. Is there another way to
identify the starting point to begin processing, i.e. in
English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.

Jul 19 '05 #2
Hello Hugh,

I don't think there is any easy to achieve this. If you know exactly where
the data is when you automate Excel, you could input it as a parameter in
your function to get the data. If you don't know, you have to search the
data by yourself. Or is it possible for you to create a special pane in
Excel file to contain the beginning area of valid data?

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ˇ°as isˇ± with no warranties and confers no rights.
Jul 19 '05 #3
Thanks for your response Tian. The Excel file is
generated by a thrid party, so I am unclear as to how I
could automate a pane. Does Colin's Find fucntion idea
make sense. How do you access it from an Asp.Net page?
-----Original Message-----
Hello Hugh,

I don't think there is any easy to achieve this. If you know exactly where the data is when you automate Excel, you could input it as a parameter in your function to get the data. If you don't know, you have to search the data by yourself. Or is it possible for you to create a special pane in Excel file to contain the beginning area of valid data?

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ˇ°as isˇ± with no warranties and confers no rights.

.

Jul 19 '05 #4
I never use A1, A2, B1 and B2 when programming. I always use the row
and columns. If you use the Find method to find the header, then you
can find the row and the column with Cel.Row and Cel.Column. Column
would be the starting column. So the first column of your table would
be StartColumn + 0, the second column of your table would be
StartColumn + 1.

You can find a cell by ExcelApp.Workbooks(1).Sheets(1).Cells(Row,
Column)

Hope this helps.

Guillaume Hanique

On Tue, 22 Jul 2003 15:29:08 -0700, "Hugh McLaughlin"
<hu**@kmcnetwork.com> wrote:
Hello Everyone and thanks for your help in advance. I am
working on an application that requires the parsing of an
Excel spreadsheet that will be loaded into a SQL Server
table. An example of the spreadsheet is located at:

http://ratesheets.sollen.com/script/...ts/interfirst/
ratesheets/IFRS1_20030722_094227.xls

At the heart of the problem is the sometimes varying
layout of the spreadsheet. For example, the application
requires that the date between cells H13 and D23 be
loaded into the table. However, the same data may be
located between H12 and D22 tomorrow. So the application
needs to be able to determine the starting point of the
data. Fortunately, the headings do not change, so one of
the obvious ways to handle this is to move through each
cell (i.e. A1, A2, B1, B2) until the known header value
is achieved. However, this seems to be a very
inefficient way to handle this. Is there another way to
identify the starting point to begin processing, i.e. in
English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.


Jul 19 '05 #5
Hugh,
Have you considered querying the Excel worksheet using ADO.NET? You
talk of headings so there's are chance your data is similar enough to
a database table i.e. rows of columns. With SQL you supply the name of
the column, not the Excel range/name. The 'English' phrase you used
sounds similar to a SQL query to me...

"Hugh McLaughlin" <hu**@kmcnetwork.com> wrote in message news:<05****************************@phx.gbl>...
Hello Everyone and thanks for your help in advance. I am
working on an application that requires the parsing of an
Excel spreadsheet that will be loaded into a SQL Server
table. An example of the spreadsheet is located at:

http://ratesheets.sollen.com/script/...ts/interfirst/
ratesheets/IFRS1_20030722_094227.xls

At the heart of the problem is the sometimes varying
layout of the spreadsheet. For example, the application
requires that the date between cells H13 and D23 be
loaded into the table. However, the same data may be
located between H12 and D22 tomorrow. So the application
needs to be able to determine the starting point of the
data. Fortunately, the headings do not change, so one of
the obvious ways to handle this is to move through each
cell (i.e. A1, A2, B1, B2) until the known header value
is achieved. However, this seems to be a very
inefficient way to handle this. Is there another way to
identify the starting point to begin processing, i.e. in
English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.

Jul 19 '05 #6
Thanks for your response. Actually, that is what I am
doing. However, the problem, unless I am missing
something, is that I need to define a range of cells.
Unfortunately, the range changes occasionally, thus a
static reference won't work. At that point, I need to
locate the appropraite starting cell for the range based
on a heading value. Any ideas?

-----Original Message-----
Hugh,
Have you considered querying the Excel worksheet using ADO.NET? Youtalk of headings so there's are chance your data is similar enough toa database table i.e. rows of columns. With SQL you supply the name ofthe column, not the Excel range/name. The 'English' phrase you usedsounds similar to a SQL query to me...

"Hugh McLaughlin" <hu**@kmcnetwork.com> wrote in message

news:<05****************************@phx.gbl>...
Hello Everyone and thanks for your help in advance. I am working on an application that requires the parsing of an Excel spreadsheet that will be loaded into a SQL Server
table. An example of the spreadsheet is located at:

http://ratesheets.sollen.com/script/...ts/interfirst/ ratesheets/IFRS1_20030722_094227.xls

At the heart of the problem is the sometimes varying
layout of the spreadsheet. For example, the application requires that the date between cells H13 and D23 be
loaded into the table. However, the same data may be
located between H12 and D22 tomorrow. So the application needs to be able to determine the starting point of the
data. Fortunately, the headings do not change, so one of the obvious ways to handle this is to move through each
cell (i.e. A1, A2, B1, B2) until the known header value
is achieved. However, this seems to be a very
inefficient way to handle this. Is there another way to identify the starting point to begin processing, i.e. in English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.

.

Jul 19 '05 #7
Short answer: automate Excel and use its object model to call the Find
method to find the range, then plug the range into your SQL e.g.

SELECT * FROM [InterFirst Rates$D12:H23]

With ASP.NET there are many ways of automating Excel. I have no way of
telling which is the best approach for your cicumstances. Take a look
at the following KB article for a discussion of the various
approaches:

http://support.microsoft.com/default...b;en-us;311452

"Hugh McLaughlin" <hu**@kmcnetwork.com> wrote in message news:<02****************************@phx.gbl>...
Thanks for your response. Actually, that is what I am
doing. However, the problem, unless I am missing
something, is that I need to define a range of cells.
Unfortunately, the range changes occasionally, thus a
static reference won't work. At that point, I need to
locate the appropraite starting cell for the range based
on a heading value. Any ideas?

-----Original Message-----
Hugh,
Have you considered querying the Excel worksheet using

ADO.NET? You
talk of headings so there's are chance your data is

similar enough to
a database table i.e. rows of columns. With SQL you

supply the name of
the column, not the Excel range/name. The 'English'

phrase you used
sounds similar to a SQL query to me...

"Hugh McLaughlin" <hu**@kmcnetwork.com> wrote in message

news:<05****************************@phx.gbl>...
Hello Everyone and thanks for your help in advance. I am working on an application that requires the parsing of an Excel spreadsheet that will be loaded into a SQL Server
table. An example of the spreadsheet is located at:

http://ratesheets.sollen.com/script/...ts/interfirst/ ratesheets/IFRS1_20030722_094227.xls

At the heart of the problem is the sometimes varying
layout of the spreadsheet. For example, the application requires that the date between cells H13 and D23 be
loaded into the table. However, the same data may be
located between H12 and D22 tomorrow. So the application needs to be able to determine the starting point of the
data. Fortunately, the headings do not change, so one of the obvious ways to handle this is to move through each
cell (i.e. A1, A2, B1, B2) until the known header value
is achieved. However, this seems to be a very
inefficient way to handle this. Is there another way to identify the starting point to begin processing, i.e. in English "Find the cell that equals 30 YEAR FIXED -
Program 100". Any ehlp would be greatly appreciated.
Thanks.

.

Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Phil Powell | last post by:
What would one best recommend to parse an existing Excel spreadsheet (was done in Excel 97 or 2000 not sure to be honest)? I am looking for the most practical way of parsing an existing...
0
by: Jeff | last post by:
I will start off by giving you a background of the process I am taking. The nature of my DTS package is that I recieve an Excel Spreadsheet, run it through the DTS Package applying validation to...
9
by: (Pete Cresswell) | last post by:
I see this coming on a develpment effort that may materialize shortly. These guys don't want to mess around with automated imports from text feeds BC in the past they've had too many problems...
0
by: Rich Wallace | last post by:
Hello all, Looking for suggestions and tips if possible. I have an application running on a file server that utilizes the FileSystemWatcher to trap when any Excel files are saved by a user. I...
15
by: Hugh McLaughlin | last post by:
Hello Everyone and thanks for your help in advance. I am working on an application that requires the parsing of an Excel spreadsheet that will be loaded into a SQL Server table. An example of...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
1
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
2
by: treybraid | last post by:
My Flash file is a GameCenter where team standings are kept.. I have it set up right now with the master spreadsheet programmed that is linked to a dummy sheet that is saved as a CVS doc and loaded...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.