+ Reply to Thread
Results 1 to 8 of 8

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

  1. #1
    vat
    Guest

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

    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!

  2. #2
    sebastienm
    Guest

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

    Hi,
    try:
    Range("A1").Cut Range("a2")
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "vat" wrote:

    > 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!


  3. #3
    vat
    Guest

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

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

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


    "sebastienm" wrote:

    > Hi,
    > try:
    > Range("A1").Cut Range("a2")
    > --
    > Regards,
    > Sébastien
    > <http://www.ondemandanalysis.com>
    >
    >
    > "vat" wrote:
    >
    > > 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!


  4. #4
    vat
    Guest

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

    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?

    "sebastienm" wrote:

    > Hi,
    > try:
    > Range("A1").Cut Range("a2")
    > --
    > Regards,
    > Sébastien
    > <http://www.ondemandanalysis.com>
    >
    >
    > "vat" wrote:
    >
    > > 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!


  5. #5
    Mark Lincoln
    Guest

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

    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.


  6. #6
    vat
    Guest

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

    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.

    "Mark Lincoln" wrote:

    > 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.
    >
    >


  7. #7
    sebastienm
    Guest

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

    - 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/...t.aspx?query=%
    22file+access+error%22
    --
    Regards,
    Tushar Mehta
    -----------------------------------------------------------------------------

    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "vat" wrote:

    > 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.
    >



  8. #8
    vat
    Guest

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

    - 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

    "sebastienm" wrote:

    > - 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/...t.aspx?query=%
    > 22file+access+error%22
    > --
    > Regards,
    > Tushar Mehta
    > -----------------------------------------------------------------------------
    >
    > --
    > Regards,
    > Sébastien
    > <http://www.ondemandanalysis.com>
    >
    >
    > "vat" wrote:
    >
    > > 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.
    > >

    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1