|First, some VBA 6.5 syntax:|
In VB 6.5, the quotes mean that the string between them is the name of the sheet. In the example above you would be referring to a sheet whose tab reads 1 - i.e. the number 1.
Similar to Sheets("Summary") which would be referring to a sheet whose tab reads Summary.
Without the quotes, VB 6.5 would look for the sheet in the first position of the workbook, regardless of the name displayed on the tab.
would refer to the second sheet, etc.
Now, as to your error:
If the error is occurring on this line:
I would guess that it has nothing specifically to do with xlEdgeRight but more with whatever VBA has Selected.
Since you are trying to set the border on the Selection, my quess is that xlApp1.range("A1") is not something that a border can be set on.
I would do some more testing and figure out exactly what gets selected by xlApp1.range("A1").Select.
Try this after that line:
If it doesn't return $A$1 then you haven't selected Range("A1").
As I mentioned in my earlier response, I get an error at this line xlApp1.Range("A1").Select since Range("A1") is not an application level object.
This code returns a bunch of MsgBoxes that all display $A$1 and then places a border on the right side of Sheet1!A1.
Dim xlApp1 As Object
Set xlApp1 = CreateObject("excel.application")
'Border gets applied here
.LineStyle = xlContinuous