Hi
When i clicked a button, i want to insert data from
listview in VB.NET to Excel sheet.
If you know the solution either above or below is ok for
me.
I know how to insert from a textfile,but all data of
textfile inserted into only into a single cell.I want to
insert single line of text file for each cell.
I tried to insert data into Excel sheet in many ways but
it will give some error when opening the Excel sheet.
data was inserted but when opening the sheet to view the
contents it gives error like this:
"Excel sheet was already opened"
but i never opened that sheet in before.
Here is the code i tried to insert into Excel sheet:
Dim fstr, mystr As String
Dim Index1, i, j As Integer
Dim ExcelWasNotRunning As Boolean
Dim str As String
Dim xlsWB As Object
Dim xlsPath, xlsFile, xlsTab As String
xlsWB = GetObject("D:\example.xls")
xlsWB.Parent.Windows(1).Visible = True
xlsWB.Application.Worksheets(xlsTab).Cells(3, 1) =
10
xlsWB.Application.Worksheets(xlsTab).Cells(3, 2)
= "C:\pagefile"
xlsWB.Application.Worksheets(xlsTab).Cells(4, 1) =
20
xlsWB.Application.Worksheets(xlsTab).Cells(4, 2)
= "D:\pagefile"
xlsWB.Application.Worksheets(xlsTab).Cells(5, 1) =
30
xlsWB.Application.Worksheets(xlsTab).Cells(5, 2)
= "E:\pagefile"
If any one knows please give me the solution
Mamatha