Hello everyone,
I have an excel which containes number of notes with a certain format that I don't want it to be changed
I only need to pass values to that certin excel ..
but I faild ..
I searched everywhere ... but it's not working with me ...
would you please help me ??!!
this is the code I am using .. but it is creating a new excel sheet .. I don't want this .. I want to have the same data in the excel plus some values...
am using .NET 2008
this is my code ... what should I change to not creat (new) file
but updating the current one and save it in diffrent location..
Dim oExcel As Excel.Application = New Excel.Application
oExcel.Workbooks.Open("D:\Test.xls")
Dim oBook As Object
Dim oSheet As Object
oBook = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook.
oSheet = oBook.Worksheets(1)
oSheet.Range("A1").Value = "Last Name"
oSheet.Range("B1").Value = "First Name"
oSheet.Range("A1:B1").Font.Bold = True
oSheet.Range("A2").Value = "Doe"
oSheet.Range("B2").Value = "John"
'Save the Workbook and quit Excel.
oBook.SaveAs("D:\Test1.xls")
oSheet = Nothing
oBook = Nothing
oExcel.Quit()
oExcel = Nothing
GC.Collect()