What is the numeric value of xlNone, xlDiagonalDown and others?

P

plh

Hello All XL Gurus,

I am calling and Excel spreadsheet as an external object from Solidworks (a
widely used CAD package) using the function

Set obEx = GetObject(strRtgFolder & strRtgFile)
where "strRtgFolder & strRtgFile" evaluates to an existing spreadsheet.

This is passed to a sub:

Call Stitch14Deg(obEx, intRtgNumStep, intNoteStart, intNoteInc)

then inside that sub to another sub:

Sub Stitch14Deg(obX As Object, intStep As Integer, intNStart As Integer, intNInc
As Integer)
....
....
....
Call HighlightActiveCell(obX, r, (c), frmStart.cmbType.Value)
....
....
End Sub

Sub HighlightActiveCell(oX As Object, r, c As Long, strSheet As String)

oX.sheets(strSheet).cells(r,c).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
....
....
....
End Sub

When it gets to HighlightActiveCell I get a "Variable not defined" Error
referring to xlNone. There are many other constants referred to. I changed the
first xlNone to 1, just to see what would happen: The message moved back to
xlDiagonalDown.
Is there a way out of this?
I was thinking that if there is a reference somewhere of the numeric value of
these constants, I could substitute them in.

The following is a list of the constants I am trying to use:
xlNone
xlContinuous
xlMedium
xlAutomatic
xlDiagonalDown
xlDiagonalUp
xlEdgeLeft
xlEdgeTop
xlEdgeBottom
xlEdgeRight
xlInsideVertical
xlInsideHorizontal

Thank You!
-plh
 
J

Jim Thomlinson

In xl try runnig this sub to see the numbers...

Sub test3()
MsgBox xlNone
MsgBox xlContinuous
MsgBox xlMedium
MsgBox xlAutomatic
MsgBox xlDiagonalDown
MsgBox xlDiagonalUp
MsgBox xlEdgeLeft
MsgBox xlEdgeTop
MsgBox xlEdgeBottom
MsgBox xlEdgeRight
MsgBox xlInsideVertical
MsgBox xlInsideHorizontal
End Sub

You can then make these values into constants
Public Const xlNone as long = -4142
....

Finally to remove the all of the borders you can use...

Selection.Border.LineStyle = xlNone
 
P

plh

Worked like a charm, thanx!
-plh
In xl try runnig this sub to see the numbers...

Sub test3()
MsgBox xlNone
MsgBox xlContinuous
MsgBox xlMedium
MsgBox xlAutomatic
MsgBox xlDiagonalDown
MsgBox xlDiagonalUp
MsgBox xlEdgeLeft
MsgBox xlEdgeTop
MsgBox xlEdgeBottom
MsgBox xlEdgeRight
MsgBox xlInsideVertical
MsgBox xlInsideHorizontal
End Sub

You can then make these values into constants
Public Const xlNone as long = -4142
...

Finally to remove the all of the borders you can use...

Selection.Border.LineStyle = xlNone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top