Can Excel "xl" VBAstatements (ie xlToRight) be used in Access VBA

A

Archie

Hi, I'm trying to do some Excel work from Access VBA. For instance:
xl1.Activesheet.Selection.PasteSpecial Paste:=xlPasteFormats,
Operation:=xlNone, _
''' SkipBlanks:=False, Transpose:=False
'''xl1.Application.CutCopyMode = False
'''xl1.Activesheet.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
''xl1.Activesheet.Selection.Borders(xlDiagonalUp).LineStyle = xlNone

Can these "xl" type statements like "xlDiagonalDown" be made to work in
Access VBA? Thanks!
 
K

Ken Snell [MVP]

Those intrinsic constants from EXCEL VBA can be used in ACCESS only if you
have a reference set to EXCEL library, which is not the recommended approach
for most things. Otherwise, you'll need to use the actual integer value for
the constant.
 
A

Archie

Thanks Ken. Can Ken or someone else direct me to a description of how to
create a reference se to the Excel library while in Access VBA?
 
K

Ken Snell [MVP]

Open Visual Basic Editor. Click Tools | References. Select the EXCEL
library.
 
Top