Hey i'm back from a student holiday Thx for all the answers i will vote 4 them... I posted the wrong code snippet here is the code that i wanted to post :
Imports Microsoft.Office.Interop
Try
Dim oApp As New Excel.Application()
Dim oBook As Excel.Workbook = oApp.Workbooks.Add
Dim oSheet As Excel.Worksheet = oApp.ActiveSheet
chartRange = oSheet.range("A20", "G20")
oSheet.Range("A20").Value = "blabla"
chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, \_
Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex. \_
xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic)
'Save the Workbook and quit Excel.
oBook.SaveAs(sSampleFolder & "V.F." & idvoorexcel & "-" & Label6.Text & "-" & DateTime.Now.ToString("ddMMyyHHmmss") & ".xlsx")
oSheet = Nothing
NAR(oSheet)
oBook.Close(False)
NAR(oBook)
oBook = Nothing
oApp.Quit()
NAR(oApp)
oApp = Nothing
System.Threading.Thread.Sleep(1500)
End If
Catch ex As Exception
NAR(oSheet)
oBook.Close(False)
NAR(oBook)
oSheet = Nothing
oBook.Close(False)
oBook = Nothing
System.Threading.Thread.Sleep(1500)
GC.Collect()
End Try
Private Sub NAR(ByVal o As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub
By the way nice link with the NAR Still don't know if i oversaw something? Thx D:thumbsup: