Excel code in Access

Curry

Registered User.
Local time
Tomorrow, 05:07
Joined
Jul 21, 2003
Messages
73
Hi There,

Does anybody know what needs to be modified in the following Excel code, so that it can be run from Access. (I have added the xlApp. as needed)

xlApp.Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

If I just have xlApp.Selection.Paste it will run fine, however I want to paste values only.

Thanks
IC
 
Curry - the same rules apply. If you have something in your code that is Excel specifc like this value "xlPasteValues" Access is going to try and find it in Access and not in Excel, thus you need to tell Access that this is an Excel specific value.

By the way my experience is that sometimes a line of code like this will work and then sometimes not. Most people with MS Word will write a question (and I did too once) "This line of code worked the first time and then the second time it gives an error" The reason was because of Word specific values that Access does not have.

If you answer my post here you would be able to implement the same things - or is that problem not over? If it is solved it would be good for the forum for you to aknowledge that the solution posted works.

http://www.access-programmers.co.uk/forums/showthread.php?t=209678
 

Users who are viewing this thread

Back
Top Bottom