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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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.
 
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?
 
Open Visual Basic Editor. Click Tools | References. Select the EXCEL
library.
 

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

Similar Threads

Help with macro 1
Copy Sheet to Desktop 1
Code issue 2
Excel Excel Macro Help 2
Formatting Excel File 9
Convert Excel vba to Access 3
Use of Selection when late binding 4
Inserting a line in a database - alternative colours 7

Back
Top