Hi,
I'm trying to export to CSV file and change the color of the cell i've write the code below but it's not working.
i'll be more than happy if you can help me 10x.
I'm trying to export to CSV file and change the color of the cell i've write the code below but it's not working.
VB.NET:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ssFile As String = Server.MapPath("גדי.csv")
Dim xlApp As Excel.Application = New Excel.Application
Dim xlbooks As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Try
xlbooks = xlApp.Workbooks.Open(ssFile)
xlsheet = xlbooks.Sheets("גדי")
xlsheet.Range("I9").Interior.ColorIndex = 4
xlbooks.Save()
Catch ex As Exception
MsgBox(ex.Message.ToString())
Finally
xlbooks.Close(True)
xlApp.Quit()
xlsheet = Nothing
xlbooks = Nothing
xlApp = Nothing
End Try
End Sub
i'll be more than happy if you can help me 10x.
Last edited by a moderator: