We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Hide borders

Hi,

How do I hide the border of the cells outside my form in excel sheet. I still want the lines to be visible within my form but outside it i want to hide the lines completely.

Can you advice please?

Hi,

I think you can use Range.SetOutlineBorders(CellBorderType[] borderStyles, Color[] borderColors) method for your need where CellBorderType enum should be none.

Thank you.

Hi Amjad,

Basically I need to make a form like this. I could not understand how you suggested me to use the borderstyles.

Could you please advice in VB.NET how to make this form?

Regards

Shalini

Hi Shalini,

Thanks for providing us the template file containing your desired form.

May the following sample code help you achieve your desired form, please check it:

Sample code:

'Create a new workbook.
Dim workbook As Workbook = New Workbook()
'Get the first worksheet.
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Set the Gridlines invisible.
worksheet.IsGridlinesVisible = False
Dim cells As Cells = worksheet.Cells
'Merge B1:J4 cells
cells.Merge(0,1,4,9)
cells("B1").PutValue("LOOKUP UPLOAD FORM")
cells("B1").Style.Font.Name = "Calibri"
cells("B1").Style.Font.Size = 36
cells("B1").Style.HorizontalAlignment = TextAlignmentType.Center

Dim range As Range = cells.CreateRange("A5","A100")
cells.SetColumnWidth(0,35)
Dim colstyle As Style = workbook.Styles(workbook.Styles.Add())
colstyle.Borders(BorderType.LeftBorder).LineStyle = CellBorderType.Thin
colstyle.Borders(BorderType.RightBorder).LineStyle = CellBorderType.Thin
colstyle.Borders(BorderType.TopBorder).LineStyle = CellBorderType.Thin
colstyle.Borders(BorderType.BottomBorder).LineStyle = CellBorderType.Thin
Dim flag As StyleFlag = New StyleFlag()
flag.Borders = True
range.ApplyStyle(colstyle,flag)

cells("A5").PutValue("Lookup Value")

worksheet.FreezePanes(5,0,5,0)

workbook.Save("f:\test\myform_test.xls")

Note: For inserting picture (your logo), please check the following documentation topic that explains how to embed images into the worksheets:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/adding-pictures.html

Hope, it will help you.

Thank you.