Hello all,
I am trying to get the all the cell-range names defined by a User in a EXCEL worksheet.
my ASP program will open an EXCEL file......
and extract all the cell range names from that excel worksheet.
What i have done till now, is that the user has to enter the cellrange name manually in a form , and that form is forwarded to a code. the code is as follows
Please do help
Thanks a lot
I am trying to get the all the cell-range names defined by a User in a EXCEL worksheet.
my ASP program will open an EXCEL file......
and extract all the cell range names from that excel worksheet.
What i have done till now, is that the user has to enter the cellrange name manually in a form , and that form is forwarded to a code. the code is as follows
Code:
'Pick the excel file from uploads
'Name of the excel file being displayed
'***************** Files **********************************************
Set fso = CreateObject("Scripting.FileSystemObject")
Set folderObject = fso.GetFolder(Server.MapPath("..\uploads\pascoreuploads\"))
Set filesObject = folderObject.Files
For Each file In filesObject
exceldb=file.name
Next
Set fileObject = Nothing
Set folderObject = Nothing
Set fso = Nothing
'================================================= ====
' Create a server connection object
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "DBQ=" & Server.MapPath("..\uploads\pascoreuploads\"& exceldb) & ";" & _
"DRIVER={Microsoft Excel Driver (*.xls)};"
' Create a server recordset object
Set rsexc = Server.CreateObject("ADODB.Recordset")
'----------------------------------------------------------------------------------------------
' Query to run against the exceldb
' is the name of the
' cell range as defined in excel
cell=Request.Form("cell_name")
sql="select * from "& cell
' Execute the sql
rsexc.Open sql,cnPlease do help
Thanks a lot
