I am creating an Excel file from Visual Basic .Net. Sample code is below. I need to know how to align the cells horizontally. Any other formatting commands would also be helpful.
objExcel = CreateObject("excel.application")
objExcel.Visible = True
objExcel.Workbooks.Add()
objExcel.sheets(sheetnam).Cells(15, 12).Value = TotCopay
objExcel.sheets(sheetnam).Cells(15, 12).Font.Size = 8
objExcel.sheets(sheetnam).Cells(15, 12).Font.Bold = True
objExcel.sheets(sheetnam).Cells(15, 12).NumberFormat = "$##0.00"
objExcel = CreateObject("excel.application")
objExcel.Visible = True
objExcel.Workbooks.Add()
objExcel.sheets(sheetnam).Cells(15, 12).Value = TotCopay
objExcel.sheets(sheetnam).Cells(15, 12).Font.Size = 8
objExcel.sheets(sheetnam).Cells(15, 12).Font.Bold = True
objExcel.sheets(sheetnam).Cells(15, 12).NumberFormat = "$##0.00"