By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

Error opening Excel file 'named range' as recordset in ASP

P: n/a
I am not sure what I am doing wrong. I am trying to open a DSNLess
connection and retrieve the data in an Excel sheet using ASP. Shouldnt
be this complicated but I've been trying to get this to work. I have a
named range called Sheet1.
Please assist me in this. Below is the CODE and ERROR.

<%
'************CODE
Dim oConn, oRs

Set oConn = Server.CreateObject("ADODB.Connection")
strOpenConn ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\EXPORT.XLS;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""

strOpenRs = "SELECT Name FROM [Range1$]; "

oConn.Open strOpenConn
Set oRs = oConn.Execute (strOpenRs)

oConn.Close
%>
***************ERROR:
Microsoft JET Database Engine error '80040e37'

The Microsoft Jet database engine could not find the object 'Range1$'.
Make sure the object exists and that you spell its name and the path
name correctly.
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I thought it was called Sheet1?

"g_mx6" <gl*******@yahoo.com> wrote in message
news:2f*************************@posting.google.co m...
I am not sure what I am doing wrong. I am trying to open a DSNLess
connection and retrieve the data in an Excel sheet using ASP. Shouldnt
be this complicated but I've been trying to get this to work. I have a
named range called Sheet1.
Please assist me in this. Below is the CODE and ERROR.

<%
'************CODE
Dim oConn, oRs

Set oConn = Server.CreateObject("ADODB.Connection")
strOpenConn ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\EXPORT.XLS;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""

strOpenRs = "SELECT Name FROM [Range1$]; "

oConn.Open strOpenConn
Set oRs = oConn.Execute (strOpenRs)

oConn.Close
%>
***************ERROR:
Microsoft JET Database Engine error '80040e37'

The Microsoft Jet database engine could not find the object 'Range1$'.
Make sure the object exists and that you spell its name and the path
name correctly.

Jul 19 '05 #2

P: n/a
I made a mistake in typing this up on this forum. the named range is
Sheet1 and I wrote Sheet1 but for some reason it does not recognize
it.

gl*******@yahoo.com (g_mx6) wrote in message news:<2f*************************@posting.google.c om>...
I am not sure what I am doing wrong. I am trying to open a DSNLess
connection and retrieve the data in an Excel sheet using ASP. Shouldnt
be this complicated but I've been trying to get this to work. I have a
named range called Sheet1.
Please assist me in this. Below is the CODE and ERROR.

<%
'************CODE
Dim oConn, oRs

Set oConn = Server.CreateObject("ADODB.Connection")
strOpenConn ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\EXPORT.XLS;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""

strOpenRs = "SELECT Name FROM [Sheet1$]; "

oConn.Open strOpenConn
Set oRs = oConn.Execute (strOpenRs)

oConn.Close
%>
***************ERROR:
Microsoft JET Database Engine error '80040e37'

The Microsoft Jet database engine could not find the object 'Sheet1$'.
Make sure the object exists and that you spell its name and the path
name correctly.

Jul 19 '05 #3

P: n/a
ok. solved it. it was just a permissions problem. I thought that the
issue was that it was not finding the named range.

But although it seemed so, the problem was in fact that the file was
not being read because of permissions. I moved the file to the server
and directly referenced it and it worked fine.

thanks all.
glenn
----------------------------------------------
gl*******@yahoo.com (g_mx6) wrote in message news:<2f*************************@posting.google.c om>...
I made a mistake in typing this up on this forum. the named range is
Sheet1 and I wrote Sheet1 but for some reason it does not recognize
it.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.