paste special

SiGill

Registered User.
Local time
Yesterday, 18:02
Joined
Dec 22, 2008
Messages
72
I have the following code which isn't working, can someone help?

xlApp.Range("D14").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Basically I am formatting an excel spreadsheet from Access then resaving as a different name.
 
Dont use line continuations and do use code tags
Code:
xlApp.Range("D14").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

the xl variables are available in excel but are not available in access that is what is causing your (unknown, since you didnt tell us) error. Go into excel find out what i.e. xlNone holds for value (-4142 ) and replace it in.
 
apologies for the lack explanation, but you did manage to answer it.

I picked up the reference in excel and replaced it in access and it worked perfectly

xlPasteValues = -4163
xlNone = -4142

Thanks for your help
 
Just a little more about this. The Excel Constants will work if you use Early Binding (setting a reference to Excel) but if you use Late Binding (i.e. - Dim appXL As Object) then you have to supply the values for the constants. You might end up creating a module with the Excel constants and importing that in whenever you are going to use Excel with late binding.
 

Users who are viewing this thread

Back
Top Bottom