What is Error "Method "Paste" of object "_Worksheet" failed?

G

Guest

I recorded the simpliest macro to move content of the cell A1 to the cell A2:

Range("A1").Select
Selection.Cut
Range("A2").Select
ActiveSheet.Paste

It returned the following error message:

Run-time error '-2147417848 (80010108)':
Method "Paste" of object "_Worksheet" failed

I copied the macro into a new workbook and it worked OK. I can't find a
difference between the workbooks.

Please help!
 
G

Guest

Thank you Sébastien, but it did not work. Now the error says

Run-time error '-2147417848 (80010108)':
Method "Cut" of object "Range" failed
 
G

Guest

OK, sebastien, that's the real situation. I wrote a macro wich pulls data
from different files and processing it in a "central" file. The whole thing
is located on the network and works great from MY computer. However, if I
try to run it from any other computer in the office (using the same files -
they are on the network), I will get the error message. I copied the
PERSONAL.XLS file from my PC to other machines but it does not help. Any
idea?
 
M

Mark Lincoln

Is the code in a Worksheet? If so, Range will fail for any Ranges
outside of the Worksheet in which the code resides.

Move the code to a Module if this is the case.
 
G

Guest

The macro is in a Module. I am sure, the problem is in some local settings,
since the program executes good in one PC and does not work on another.
 
G

Guest

- Is the book in shared mode?
- do all computers are running same OS/Office version?

I searched this newsgroup for similar issues (looking for "network error"):
----------------------------------------------------------------------------------
- "This'll stump you! Problem with Copy Sheet between Excel"
This is speculation but you may be having problems because of the
AccessMode specification. It might be hard to debug remotely but does
the client have problems with the 2nd (or subsequent) attempt to create
the file? If so, it increases the likelihood of the AccessMode causing
the problem.
Can you ensure that the file is always under exclusive control before
you try and overwrite it? Or, as a test, can you create a new file
name each time? Does the problem still occur?
If the file is on a network drive there might be additional
security/sharing issues introduced into the analysis by the network
management software.
Finally, you may want to search support.microsoft.com for your error:
http://support.microsoft.com/search/default.aspx?query=%
22file+access+error%22
 
G

Guest

- No. It's never used by more than one user at a time
- Yes.

Thank you for your help. I had to re-write the whole thing bypassing the
issue. I made it work without copy/cut/paste.

Thanks you again
 

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