PHFrench
asked on
Creating and Deleting worksheets in Excel usign Visual Studio
I want to export data to an existing excel spreadsheet and into a specific worksheet. Each time I will need to delete and then re-create the worksheet. But I do not know what the command is for either. I tried the following to create it and it processed thru without error but i do not see it when I open the spreadsheet (it did not previously exist). I am using Visual Studio 2008.
Dim SQL1 = "Create Table [TestData2]"
Dim ExcelConnection As New System.Data.OleDb.OleDbCon nection("P rovider=Mi crosoft.Je t.OLEDB.4. 0;" & _
"Data Source=" & “c:\test.xls” & ";" & _
"Extended Properties=""Excel 8.0;HDR=YES""")
ExcelConnection.Open()
Dim ExcelCommand As New System.Data.OleDb.OleDbCom mand(SQL1, ExcelConnection)
ExcelCommand.ExecuteNonQue ry()
Dim SQL1 = "Create Table [TestData2]"
Dim ExcelConnection As New System.Data.OleDb.OleDbCon
"Data Source=" & “c:\test.xls” & ";" & _
"Extended Properties=""Excel 8.0;HDR=YES""")
ExcelConnection.Open()
Dim ExcelCommand As New System.Data.OleDb.OleDbCom
ExcelCommand.ExecuteNonQue
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.