You are going about this a very strange way.
Dim s1 As String = ""
...
For Each p1 As PointLatLng In lLines3
s1 += p1.Lat + "," + p1.Lng
Next
Strings are immutable. In other words they cannot be changed. You are actually getting a brand new string for every iteration of that loop - not very efficient. If you are going to build strings up then use the
StringBuilder Class[
^]
So now you have a comma-separated list of some values, which you use a a format string to get data from the clipboard?
Clipboard.GetData(s1)
I don't think you really mean to do that. Perhaps you are trying to put s1 into the clipboard...
Clipboard.SetText(s1)
Which leads me to your next problem
oBook.Worksheets(1).Paste()
I suspect that you think you are going to get the values from above in columns A,B,C,D,E,F... etc. You are not. You will get a comma-separated list of values as a string in Cell A1. (Well that's what you will get if you fix the Clipboard problem above, otherwise you will get whatever, if anything, you last copied into the Clipboard).
You then attempt to insert the same data into the same cell (again!) ...
oSheet.Range("A1").Value = s1
But you have not initialised
oSheet
. You need to give it a value before you can use it e.g.
oSheet = oBook.Worksheets(1)
The problems are not so obvious with the next two lines
oBook.SaveAs("C:\Book1.xls")
In most systems you have to have administrator rights to be able to write to the root of the C: drive. You also don't want the root folder to become too cluttered ... stick the file into a folder - e.g. C:\Temp.
You should also give it a sensible name rather than using the Excel default name - you are less likely to overwrite a file you might have wanted to keep and it makes life easier if you need to tidy up after yourself.
oExcel.Quit()
There isn't a problem per se with just quitting excel like this but occasionally you might get an error suggesting that Excel is having problems closing down. Try closing the book first to overcome that
oBook.Close()
The code that follows is how I would have done this except that I haven't bothered with any error handling, checking if the file already exists, safety checks on values etc etc.
Dim oExcel As Excel.Application = New Excel.Application()
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
oBook = oExcel.Workbooks.Add
If (oBook.Worksheets.Count = 0) Then
oBook.Worksheets.Add()
End If
oSheet = oBook.Worksheets(1)
Dim i As Integer = 0
For Each p1 As PointLatLng In lLines3
oSheet.Range("A1").Offset(0, i).Value2 = p1.lat
oSheet.Range("A1").Offset(0, i + 1).Value2 = p1.lng
i += 2
Next
oBook.SaveAs("C:\Temp\PointLatLng.xls")
oBook.Close()
oExcel.Quit()