Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried using the JET OLE DB provider i.e.
XLconn.ConnectionString = "Source=" & FileName & _ ";Extended Properties='Excel 8.0' -- "nate axtell" <naxtell at progeny dot net wrote in message ... I'm programming with VBScript and Javascript in an ASP page (NOT .NET). I am openning an ADO connection with the Excel driver, then recording the contents of the file to a recordset. FileName = "path to file..." Set XLconn = CreateObject("ADODB.Connection") XLconn.ConnectionString = "DBQ=" & FileName & ";DRIVER={Microsoft Excel Driver (*.xls)};" XLconn.Open XLsql = "SELECT * FROM [Sheet1$]" Set XLrs = CreateObject("ADODB.Recordset") 'Recreate the recordset XLrs.cursortype = 3 XLrs.open XLsql, XLconn 'use the rs 'then code to close and set the connection and recordset to Nothing Here is my dilemma: If the Excel file that I am trying to read is already open when the web page loads I do not receive any errors. But once the page is done loading and I close the Excel file, any time I try to open any Excel file afterwards the grid section will not appear. It is almost as if some of the drivers get confused because the file was open when made the connection to it. This doesn't happen if I have other Excel files open when loading the webpage, only if I have the specific file open that I'm trying to read. Does anyone know of a way to check if the file is already being used? --nate |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
how to convert excle file in csv file in vbscript? | Excel Discussion (Misc queries) | |||
Can i include a vbscript file with an xml spreadsheet? | Excel Discussion (Misc queries) | |||
Creating properly formatted text file from vbscript using excel data | Excel Programming | |||
open Excel workbook using vbscript | Excel Programming |