Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the edge(border) property of a excel cell

Status
Not open for further replies.

TonCoronel

Programmer
Dec 1, 2003
37
NL
I am trying to change the border around a cell from powerbuilder.

lobjExcel.Activesheet.Cells(20,1).border.lineStyle = 1
this will put a border around the cell but I just want the leftside of the cell to show up. I tried alot of thnigs like:

lobjExcel.Activesheet.Cells(20,1).border(xledgeleft.lineStyle = 1
lobjExcel.Activesheet.Cells(20,1).border(edgeleft.lineStyle = 1
lobjExcel.Activesheet.Cells(20,1).border.edgeleft.lineStyle = 1
and so one.

does anybody now how to do this?
 
i suggest that u open excel > record a new macro > apply ur desired changes > stop recording > edit the macro and view the vbcode.

So, in ur case this is what i got....
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

u now need to convert this vb code into powerbuilder. keep trying
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top