Formatting Excel

Hi:

I’m struggling with a very small thing - I’m trying to create a border around a range of cells in excel with Lotus script. I’ve looked up the MS Help, and I’ve searched here as well and cannot seem to crack it. In a last ditch attempt, I was hoping someone might be able to look at this and tell me what I’m doing wrong.

object.range(“B7:L10”).Select
With Selection.Borders(xlEdgeLeft) <—whines here
.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

Thanks

Subject: What error message do you get?

My best guess is that Excel constants (like e.g. xlEdgeLeft) might be undefined in the context of your LS code. To know for sure you’d need to add an error handler to your code to obtain the exact error message.

Subject: Use the VBA editor

You need to change all of the ‘xl’ to numeric values.

Bring up the VBA editor

Bring up the browser (I think it’s F12)

Find the attribute you’re looking for and you’ll see the numeric value for it.

I can’t find a quick link, but in one of the forums there is a post that describes how to convert VBA into LS. This is helpful for what you’re trying to do since the format VBA generates may not work directly in Notes/LS.

There are lots of posts going back to the 4/5 forum on this topic. You may also want to poke around OpenNTF.org for more examples.

Subject: Use “border around”

Hi,

I’m using this code to add border:

ForAll cell In xlsheet.Range(“A”+Cstr(firstrow)).Resize(x, 8)
With cell
’ .BorderAround xlContinuous, xlThin
.BorderAround 1,2
End With
End ForAll

You can find Excel constants here: List of All Excel Constants | SmarterDataCollection http://www.smarterdatacollection.com/Blog/?p=374

Attila

Subject: Use the VBA editor

You need to change all of the ‘xl’ to numeric values.

Bring up the VBA editor

Bring up the browser (I think it’s F12)

Find the attribute you’re looking for and you’ll see the numeric value for it.

I can’t find a quick link, but in one of the forums there is a post that describes how to convert VBA into LS. This is helpful for what you’re trying to do since the format VBA generates may not work directly in Notes/LS.

There are lots of posts going back to the 4/5 forum on this topic. You may also want to poke around OpenNTF.org for more examples.