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=Micro soft.Jet.OLEDB. 4.0;" &
_
"Data Source=" & Server.MapPath( "~/
ExcelImportPayO ut.xls") & ";" & _
"Extended Properties=Exce l 8.0;"
' create your excel connection object using the connection
string
Dim objXConn As New Data.OleDb.OleD bConnection(xCo nnStr)
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.OleD bCommand("SELEC T * 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=Micro soft.Jet.OLEDB. 4.0;" &
_
"Data Source=" & Server.MapPath( "~/
ExcelImportPayO ut.xls") & ";" & _
"Extended Properties=Exce l 8.0;"
' create your excel connection object using the connection
string
Dim objXConn As New Data.OleDb.OleD bConnection(xCo nnStr)
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.OleD bCommand("SELEC T * FROM
[Sheet1$]", objXConn)
Return objCommand
Pls Help
Comment