A
Ahmd
Error: - the process cannot access the file. XXXXX.xls becuase it is
being used by another process.
I used OLE DB for opening EXCEL File ; -
' Connect to the Excel Spreadsheet
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
"Data Source=" & Server.MapPath("~/
ExcelImportPayOut.xls") & ";" & _
"Extended Properties=Excel 8.0;"
' create your excel connection object using the connection
string
Dim objXConn As New Data.OleDb.OleDbConnection(xConnStr)
objXConn.Open()
' use a SQL Select command to retrieve the data from the Excel
Spreadsheet
' the "table name" is the name of the worksheet within the
spreadsheet
' in this case, the worksheet name is "Members" and is coded
as: [Members$]
Dim objCommand As New Data.OleDb.OleDbCommand("SELECT * FROM
[Sheet1$]", objXConn)
Return objCommand
Pls Help
being used by another process.
I used OLE DB for opening EXCEL File ; -
' Connect to the Excel Spreadsheet
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
"Data Source=" & Server.MapPath("~/
ExcelImportPayOut.xls") & ";" & _
"Extended Properties=Excel 8.0;"
' create your excel connection object using the connection
string
Dim objXConn As New Data.OleDb.OleDbConnection(xConnStr)
objXConn.Open()
' use a SQL Select command to retrieve the data from the Excel
Spreadsheet
' the "table name" is the name of the worksheet within the
spreadsheet
' in this case, the worksheet name is "Members" and is coded
as: [Members$]
Dim objCommand As New Data.OleDb.OleDbCommand("SELECT * FROM
[Sheet1$]", objXConn)
Return objCommand
Pls Help